Created
December 11, 2010 16:14
-
-
Save Cellane/737446 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| \documentclass{beamer} | |
| \usetheme{Montpellier} | |
| \usefonttheme{serif} | |
| \usecolortheme{crane} | |
| \usenavigationsymbolstemplate{} | |
| \setbeamercovered{dynamic} % or transparent? | |
| \usepackage{polyglossia} | |
| \setdefaultlanguage{czech} | |
| \usepackage{fontspec} | |
| \setmainfont{Futura} | |
| \usepackage{listings} | |
| \title{Grafický rastrový editor \\přizpůsobený běhu na platformě Mac} | |
| \author{Milan Vít} | |
| \date{\today{}} | |
| \institute{Ostravská univerzita v Ostravě} | |
| \begin{document} | |
| \frame{ | |
| \titlepage | |
| } | |
| \frame{ | |
| \frametitle{Osnova} | |
| \tableofcontents[pausesections] | |
| } | |
| \section{Optimalizace pro platformu Mac} | |
| \subsection{Aplikační menu} | |
| \frame{ | |
| \frametitle{Aplikační menu} | |
| \begin{itemize} | |
| \only<1>{ | |
| \item konflikt: | |
| \begin{itemize} | |
| \item aplikace pro Mac neobsahují menu v záhlaví okna | |
| \item aplikace v Javě umisťují menu do záhlaví okna | |
| \end{itemize} | |
| } | |
| \only<2>{ | |
| \item řešení: | |
| \begin{itemize} | |
| \item přidáním parametru příkazové řádky \path{-Dapple.laf.useScreenMenuBar=true} | |
| \item změnou souboru \path{Info.plist} | |
| \end{itemize} | |
| } | |
| \end{itemize} | |
| } | |
| \frame{ | |
| \frametitle{Soubor \path{Info.plist}} | |
| \begin{itemize} | |
| \item \path{Info.plist} je XML soubor | |
| \item je nezbytnou součástí každé aplikace pro Mac | |
| \item oznamuje systému důležité informace o aplikaci: | |
| \begin{itemize} | |
| \item název | |
| \item identifikátor | |
| \item popis | |
| \item verzi | |
| \item umístění ikonky | |
| \item … | |
| \end{itemize} | |
| \item umožňuje změnit pozici aplikačního menu | |
| \end{itemize} | |
| } | |
| \frame[containsverbatim]{ | |
| \begin{verbatim} | |
| <?xml version="1.0" encoding="UTF-8"?> | |
| <!DOCTYPE plist SYSTEM | |
| "file:///System/Library/DTDs/PropertyList.dtd"> | |
| <plist version="0.9"> | |
| <dict> | |
| <key>Java</key> | |
| <dict> | |
| <key>Properties</key> | |
| <dict> | |
| <key>apple.laf.useScreenMenuBar</key> | |
| <string>true</string> | |
| </dict> | |
| </dict> | |
| </dict> | |
| </plist> | |
| \end{verbatim} | |
| } | |
| \subsection{Výběr souboru} | |
| \frame{ | |
| \frametitle{Dialog pro výběr souboru} | |
| \begin{itemize} | |
| \item Java nabízí dva různé dialogy: | |
| \begin{itemize} | |
| \item novější z toolkitu Swing | |
| \item starší z toolkitu Awt | |
| \end{itemize} | |
| \item novější neznamená lepší | |
| \end{itemize} | |
| } | |
| \frame{ | |
| \frametitle{Swingový dialog} | |
| \begin{center} | |
| \includegraphics[width=9cm]{images/filechooser-1.png} | |
| \end{center} | |
| } | |
| \frame{ | |
| \frametitle{Awtčkový dialog} | |
| \begin{center} | |
| \includegraphics[width=9cm]{images/filechooser-2.png} | |
| \end{center} | |
| } | |
| \subsection{Lišta nástrojů} | |
| \frame{ | |
| \frametitle{Lišta nástrojů} | |
| \begin{itemize} | |
| \only<1>{ | |
| \item problémy: | |
| \begin{itemize} | |
| \item tlačítka na liště nástrojů nerespektují systémový vzhled | |
| \item tlačítka mohou získat focus | |
| \item lišta nástrojů a plátno není vizuálně odděleno | |
| \end{itemize} | |
| } | |
| \only<2>{ | |
| \item řešení: | |
| \begin{itemize} | |
| \item nastavení tzv. \emph{client properties} | |
| \item přidání tzv. \emph{mouse listener}u | |
| \item přidání \path{JPanel}u mezi lištu a plátno | |
| \end{itemize} | |
| } | |
| \end{itemize} | |
| } | |
| \frame[containsverbatim]{ | |
| \begin{verbatim} | |
| dotButton.putClientProperty ("JButton.segmentPosition", | |
| "first"); | |
| dotButton.putClientProperty ("JButton.buttonType", | |
| "segmentedTextured"); | |
| penButton.putClientProperty ("JButton.segmentPosition", | |
| "middle"); | |
| clearButton.putClientProperty ("JButton.segmentPosition", | |
| "last"); | |
| \end{verbatim} | |
| } | |
| \frame[containsverbatim]{ | |
| \begin{verbatim} | |
| dotButton.addMouseListener (new FixFocusClass ()); | |
| private class FixFocusClass implements MouseListener { | |
| public void mouseReleased (MouseEvent e) { | |
| canvas.requestFocusInWindow (); | |
| } | |
| public void mouseClicked (MouseEvent e) { | |
| canvas.requestFocusInWindow (); | |
| } | |
| public void mousePressed (MouseEvent e) { | |
| canvas.requestFocusInWindow (); | |
| } | |
| } | |
| \end{verbatim} | |
| } | |
| \frame[containsverbatim]{ | |
| \begin{verbatim} | |
| panel.setPreferredSize (new Dimension (800, 1)); | |
| panel.setBackground (new Color (64, 64, 64)); | |
| this.addWindowFocusListener ( | |
| new FocusActionClass (panel)); | |
| \end{verbatim} | |
| } | |
| \frame[containsverbatim]{ | |
| \begin{verbatim} | |
| private class FocusActionClass | |
| implements WindowFocusListener { | |
| private JPanel panel; | |
| public FocusActionClass (JPanel panel) { | |
| this.panel = panel; | |
| } | |
| public void windowGainedFocus (WindowEvent e) { | |
| panel.setBackground (new Color (64, 64, 64)); | |
| } | |
| public void windowLostFocus (WindowEvent e) { | |
| panel.setBackground (new Color (135, 135, 135)); | |
| } | |
| } | |
| \end{verbatim} | |
| } | |
| \section{Vytvoření aplikačního balíčku} | |
| \subsection{Nástroje} | |
| \frame{ | |
| \frametitle{Potřebné nástroje} | |
| \begin{itemize} | |
| \item \textbf{Icon Composer} pro vytvoření ikonky s příponou \path{.icns} | |
| \item \textbf{Jar Bundler} pro vytvoření aplikačního balíčku s příponou \path{.app} | |
| \item obojí je součástí bezplatného vývojového prostředí Xcode 4 (Apple) | |
| \end{itemize} | |
| } | |
| \subsection{Vytváření ikonky} | |
| \frame{ | |
| \frametitle{Vytváření ikonky v nástroji \textbf{Icon Composer}} | |
| \begin{center} | |
| \only<1>{ | |
| \includegraphics[width=9cm]{images/icon-composer-1.png} | |
| } | |
| \only<2>{ | |
| \includegraphics[width=9cm]{images/icon-composer-2.png} | |
| } | |
| \end{center} | |
| } | |
| \subsection{Vytváření balíčku} | |
| \frame{ | |
| \frametitle{Vytváření aplikačního balíčku v nástroji \textbf{Jar Bundler}} | |
| \begin{center} | |
| \only<1>{ | |
| \includegraphics[width=8cm]{images/jar-bundler-1.png} | |
| } | |
| \only<2>{ | |
| \includegraphics[width=8cm]{images/jar-bundler-2.png} | |
| } | |
| \only<3>{ | |
| \includegraphics[width=8cm]{images/jar-bundler-3.png} | |
| } | |
| \end{center} | |
| } | |
| \section*{Závěr} | |
| \frame{ | |
| \frametitle{Závěrem} | |
| \begin{itemize} | |
| \item Děkuji za pozornost! | |
| \end{itemize} | |
| } | |
| \end{document} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment