Class Client

  • All Implemented Interfaces:
    java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible, javax.swing.RootPaneContainer, javax.swing.WindowConstants, ShortcutListener, PreferencesFactory, org.simplericity.macify.eawt.ApplicationListener

    public class Client
    extends javax.swing.JFrame
    implements ShortcutListener, PreferencesFactory, org.simplericity.macify.eawt.ApplicationListener
    This class is the root of all evil. It represents also the main entry point into the application and also the basic frame the application creates. It is a singleton which is instantiated from main(String[]) and stored in INSTANCE
    Version:
    $Revision: 388 $
    Author:
    $Author: $
    See Also:
    Serialized Form
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  Client.Parameters
      Stores command line parameters
      protected class  Client.ReportObserver
      Simple class to look for events changing the data.
      • Nested classes/interfaces inherited from class javax.swing.JFrame

        javax.swing.JFrame.AccessibleJFrame
      • Nested classes/interfaces inherited from class java.awt.Frame

        java.awt.Frame.AccessibleAWTFrame
      • Nested classes/interfaces inherited from class java.awt.Window

        java.awt.Window.AccessibleAWTWindow, java.awt.Window.Type
      • Nested classes/interfaces inherited from class java.awt.Container

        java.awt.Container.AccessibleAWTContainer
      • Nested classes/interfaces inherited from class java.awt.Component

        java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String COMPLETIONSETTINGS_FILENAME
      Deprecated.
      A separate completion file is no longer actively supported
      static java.lang.String DEFAULT_LAF  
      static java.lang.String FALLBACK_LAF  
      static Client INSTANCE
      This is the instance of this class
      static java.io.File logFile  
      protected java.util.Collection<MagellanPlugIn> plugIns
      contains the list of all loadable plugins
      protected javax.swing.JMenuItem progressItem  
      static java.lang.String SETTINGS_FILENAME
      The name of the magellan settings file.
      protected boolean showStatus
      show order status in title
      protected static StartWindow startWindow
      start window, disposed after first init
      • Fields inherited from class javax.swing.JFrame

        accessibleContext, rootPane, rootPaneCheckingEnabled
      • Fields inherited from class java.awt.Frame

        CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSOR
      • Fields inherited from class java.awt.Component

        BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
      • Fields inherited from interface java.awt.image.ImageObserver

        ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
      • Fields inherited from interface javax.swing.WindowConstants

        DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, EXIT_ON_CLOSE, HIDE_ON_CLOSE
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected Client​(GameData gd, java.io.File binDir, java.io.File resourceDir, java.io.File settingsDir, boolean ask, java.io.File logFile)
      Creates a new Client object taking its data from gd.
      protected Client​(GameData gd, java.io.File binDir, java.io.File resourceDir, java.io.File settingsDir, java.io.File logFile)
      Creates a new Client object taking its data from gd.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      void addFileToHistory​(java.io.File f)
      Adds a single file to the file history.
      void addInspector​(Inspector inspector)
      Adds a new inspector to the taskpanel
      void addInspectorInterceptor​(InspectorInterceptor interceptor)
      Adds a new inspector interceptor to the taskpanel inspectors
      int askToSave()
      Asks the user whether the current report should be saved but does not do it!
      protected static void bailOut​(java.lang.Throwable t)  
      protected javax.swing.JMenu createBookmarkMenu()  
      protected javax.swing.JMenu createEditMenu()  
      protected javax.swing.JMenu createExtrasMenu()  
      protected javax.swing.JMenu createFileMenu()  
      protected javax.swing.JMenu createMapMenu()  
      protected javax.swing.JMenu createOrdersMenu()  
      PreferencesAdapter createPreferencesAdapter()
      Returns an adapter for the preferences of this class.
      static java.lang.String debug​(java.awt.Component comp)
      Returns a String representing all parts of the component for debugging.
      static java.awt.Image getApplicationIcon()
      Returns the application icon
      static java.io.File getBinaryDirectory()
      Returns the directory where the binaries are.
      BookmarkManager getBookmarkManager()  
      GameData getData()
      Returns the current GameData.
      static java.awt.FontMetrics getDefaultFontMetrics​(java.awt.Font font)
      Deprecated.
      As of Java 1.2, the Font method getLineMetrics should be used.
      MagellanDesktop getDesktop()  
      EventDispatcher getDispatcher()
      Returns the current event dispatcher.
      int getLevel()
      Get the Level on the mapper Panel.
      java.lang.String getListenerDescription()
      Returns a (localized) description (or name) for this listener.
      static java.io.File getLogFile()
      Returns the value of logFile.
      java.lang.String[] getLookAndFeels()
      DOCUMENT-ME
      MagellanContext getMagellanContext()
      Returns the MagellanContext
      static java.io.File getMagellanDirectory()
      Deprecated.
      int getMaxFileHistorySize()
      Returns the maximum number of entries in the history of loaded files.
      MessagePanel getMessagePanel()
      Returns the message panel.
      java.util.Collection<MagellanPlugIn> getPlugIns()
      Returns a list of all loaded magellan plugins.
      java.util.Properties getProperties()
      Returns the global settings used by Magellan.
      static java.io.File getResourceDirectory()
      Returns the directory for the Magellan resources.
      SelectionEvent getSelectedObjects()
      Returns all currenty selected objects.
      java.util.Map<CoordinateID,​Region> getSelectedRegions()
      Get the selected Regions.
      static java.io.File getSettingsDirectory()
      Returns the directory for the Magellan settings.
      java.lang.String getShortcutDescription​(javax.swing.KeyStroke stroke)
      Returns a short description for the specified thing...
      java.util.Iterator<javax.swing.KeyStroke> getShortCuts()
      Empty because registered directly.
      void handleAbout​(org.simplericity.macify.eawt.ApplicationEvent event)
      Handles mac specific about menu action event
      void handleOpenApplication​(org.simplericity.macify.eawt.ApplicationEvent event)
      Handles mac specific open application event (I think, we don't use it)
      void handleOpenFile​(org.simplericity.macify.eawt.ApplicationEvent event)
      Handles mac specific file open operation (if someone opens a cr in the finder)
      void handlePreferences​(org.simplericity.macify.eawt.ApplicationEvent event)
      Handles mac specific preferences menu action event
      void handlePrintFile​(org.simplericity.macify.eawt.ApplicationEvent event)
      Handles mac specific print event
      void handleQuit​(org.simplericity.macify.eawt.ApplicationEvent event)
      Handles mac specific quit menu event
      void handleReOpenApplication​(org.simplericity.macify.eawt.ApplicationEvent event)
      Handles a reopen event - what ever that means
      protected java.util.Map<java.lang.String,​java.awt.Component> initComponents​(java.util.List<java.awt.Container> topLevel)
      Initializes the Magellan components.
      static void initECheckPath​(java.util.Properties settings)
      on windows-OS tries to locate the included ECheck.exe and if found save the path into properties
      protected void initLocales​(java.util.Properties settings, boolean ask)  
      protected static java.util.Properties initNewSettings()  
      void initPlugIns()
      This method tries to load all Magellan PlugIns.
      protected void initUI()
      Inits base UI things: # frame icon # window event things # fonts # repaint shortcut # L&F
      boolean isReportChanged()
      Returns true if the report has changed since last save/load.
      boolean isShowingStatus()
      Returns true if order status should be shown in title.
      GameData loadCR​(UserInterface ui, java.io.File fileName)
      Loads game data from a file and returns it.
      void loadCRThread​(boolean saveFirst, java.io.File fileName)
      This method asynchronously loads a CR into the client.
      void loadCRThread​(java.io.File fileName)
      This method asynchronously loads a CR into the client.
      static java.util.Properties loadSettings​(java.io.File directory, java.lang.String fileName)
      Load the file fileName in the given directory into the settings object.
      static void main​(java.lang.String[] args)
      START & END Code
      protected static Client.Parameters parseCommandLine​(java.lang.String[] args)
      Recognizes the following parameters:
      -log X -- set log level X
      --help -- start only help dialog
      -d dir -- set resource directory
      -s dir -- set settings (aka profiles) directory
      -p profile -- set profile
      -pm -- show profile manager
      -s dir -- set settings (aka profiles) directory
      file.
      void quit​(boolean storeSettings)
      This method should be called before the application is terminated in order to store GUI settings etc.
      void repaint()  
      void repaint​(int millis)
      Repaints all components.
      protected CRWriter saveReport()
      Tries to determine the correct file type for the current data and starts saving it, if successful.
      CRWriter saveReport​(FileType filetype)
      Starts saving the current data to the given filetype.
      protected boolean saveSynchronously()
      Saves the current data and waits until saving is finished.
      void setAdditionalIconInfo​(int data)
      Adds a small hint to the icon (only available on mac os)
      void setAllVisible​(boolean v)  
      void setData​(GameData newData)
      Sets a new GameData and notifies all game data listeners.
      void setDefaultIconInfo()
      Replaces the application icon in a Mac application with the default mac icon of Magellan.
      void setGirth​(BoxTransformer.BBoxes newBorders)
      Sets the girth of the world in all layers.
      void setLookAndFeel​(java.lang.String laf)  
      void setMaxFileHistorySize​(int size)
      Allows to set the maximum number of files appearing in the file history.
      void setOrigin​(CoordinateID newOrigin)
      Sets the origin of this client's data to newOrigin.
      void setReportChanged​(boolean changed)
      Changes to the report state can be done here.
      void setShowStatus​(boolean bool)
      Changes the progress display behaviour.
      void shortCut​(javax.swing.KeyStroke shortcut)
      Repaints the client.
      protected static java.io.File startLog​(Client.Parameters parameters)
      Open the log file and log basic information to it.
      protected void updateAppIconCaption()
      This method updates the app icon based on not confirmed units
      void updateLaF()
      DOCUMENT-ME
      • Methods inherited from class javax.swing.JFrame

        addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setIconImage, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, update
      • Methods inherited from class java.awt.Frame

        addNotify, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setBackground, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setOpacity, setResizable, setShape, setState, setTitle, setUndecorated
      • Methods inherited from class java.awt.Window

        addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBackground, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOpacity, getOwnedWindows, getOwner, getOwnerlessWindows, getShape, getToolkit, getType, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isAutoRequestFocus, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isOpaque, isShowing, isValidateRoot, pack, paint, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setAutoRequestFocus, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImages, setLocation, setLocation, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setType, setVisible, show, toBack, toFront
      • Methods inherited from class java.awt.Container

        add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusDownCycle, validate, validateTree
      • Methods inherited from class java.awt.Component

        action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, requestFocus, requestFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, requestFocusInWindow, resize, resize, revalidate, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setMaximumSize, setMixingCutoutShape, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.awt.MenuContainer

        getFont, postEvent
    • Field Detail

      • SETTINGS_FILENAME

        public static final java.lang.String SETTINGS_FILENAME
        The name of the magellan settings file.
        See Also:
        Constant Field Values
      • COMPLETIONSETTINGS_FILENAME

        @Deprecated
        public static final java.lang.String COMPLETIONSETTINGS_FILENAME
        Deprecated.
        A separate completion file is no longer actively supported
        The name of the ini file for order completions.
        See Also:
        Constant Field Values
      • INSTANCE

        public static Client INSTANCE
        This is the instance of this class
      • logFile

        public static java.io.File logFile
      • showStatus

        protected boolean showStatus
        show order status in title
      • progressItem

        protected javax.swing.JMenuItem progressItem
      • startWindow

        protected static StartWindow startWindow
        start window, disposed after first init
      • plugIns

        protected java.util.Collection<MagellanPlugIn> plugIns
        contains the list of all loadable plugins
    • Constructor Detail

      • Client

        protected Client​(GameData gd,
                         java.io.File binDir,
                         java.io.File resourceDir,
                         java.io.File settingsDir,
                         java.io.File logFile)
        Creates a new Client object taking its data from gd.

        Preferences are read from and stored in a file called magellan.ini. This file is usually located in the user's home directory, which is the Windows directory in a Microsoft Windows environment.

        Parameters:
        gd -
        binDir - The directory where magellan files are situated
        resourceDir - The directory where magellan configuration files are situated
        settingsDir - The directory where the settings are situated
      • Client

        protected Client​(GameData gd,
                         java.io.File binDir,
                         java.io.File resourceDir,
                         java.io.File settingsDir,
                         boolean ask,
                         java.io.File logFile)
        Creates a new Client object taking its data from gd.

        Preferences are read from and stored in a file called magellan.ini. This file is usually located in the user's home directory, which is the Windows directory in a Microsoft Windows environment.

        Parameters:
        gd -
        binDir - The directory where magellan files are situated
        resourceDir - The directory where magellan configuration files are situated
        settingsDir - The directory where the settings are situated
        ask - show the ask password dialog, used for testing only
    • Method Detail

      • initNewSettings

        protected static java.util.Properties initNewSettings()
      • loadSettings

        public static java.util.Properties loadSettings​(java.io.File directory,
                                                        java.lang.String fileName)
        Load the file fileName in the given directory into the settings object.
      • initLocales

        protected void initLocales​(java.util.Properties settings,
                                   boolean ask)
      • getMagellanContext

        public MagellanContext getMagellanContext()
        Returns the MagellanContext
      • getMessagePanel

        public MessagePanel getMessagePanel()
        Returns the message panel.
      • getApplicationIcon

        public static java.awt.Image getApplicationIcon()
        Returns the application icon
        Returns:
        the application icon
      • initUI

        protected void initUI()
        Inits base UI things: # frame icon # window event things # fonts # repaint shortcut # L&F
      • initComponents

        protected java.util.Map<java.lang.String,​java.awt.Component> initComponents​(java.util.List<java.awt.Container> topLevel)
        Initializes the Magellan components. The returned hashtable holds all components with well-known desktop keywords.
        Parameters:
        topLevel -
      • createFileMenu

        protected javax.swing.JMenu createFileMenu()
      • createEditMenu

        protected javax.swing.JMenu createEditMenu()
      • createOrdersMenu

        protected javax.swing.JMenu createOrdersMenu()
      • createMapMenu

        protected javax.swing.JMenu createMapMenu()
      • createBookmarkMenu

        protected javax.swing.JMenu createBookmarkMenu()
      • createExtrasMenu

        protected javax.swing.JMenu createExtrasMenu()
      • getDefaultFontMetrics

        @Deprecated
        public static java.awt.FontMetrics getDefaultFontMetrics​(java.awt.Font font)
        Deprecated.
        As of Java 1.2, the Font method getLineMetrics should be used.
        Parameters:
        font -
        Returns:
        the screen metrics of the specified font in the default toolkit
        See Also:
        Toolkit.getFontMetrics(Font)
      • main

        public static void main​(java.lang.String[] args)
        START & END Code
      • bailOut

        protected static void bailOut​(java.lang.Throwable t)
      • startLog

        protected static java.io.File startLog​(Client.Parameters parameters)
                                        throws java.io.IOException
        Open the log file and log basic information to it.
        Parameters:
        parameters -
        Throws:
        java.io.IOException - if an I/O error occurs
      • parseCommandLine

        protected static Client.Parameters parseCommandLine​(java.lang.String[] args)
        Recognizes the following parameters:
        -log X -- set log level X
        --help -- start only help dialog
        -d dir -- set resource directory
        -s dir -- set settings (aka profiles) directory
        -p profile -- set profile
        -pm -- show profile manager
        -s dir -- set settings (aka profiles) directory
        file.[cr|bz2|zip] -- set report
        Parameters:
        args -
      • askToSave

        public int askToSave()
        Asks the user whether the current report should be saved but does not do it!
        Returns:
        JOptionPane.YES_OPTION if the user selected to save the report, JOptionPane.NO_OPTION if the user selected not to save it, JOptionPane.CANCEL_OPTION if saving is not possible or the user selected to cancel the operation.
      • saveSynchronously

        protected boolean saveSynchronously()
        Saves the current data and waits until saving is finished.
        Returns:
        true if data was successfully saved.
      • saveReport

        protected CRWriter saveReport()
        Tries to determine the correct file type for the current data and starts saving it, if successful. Saving is done in a new thread.
        Returns:
        The writer that has started saving in another thread. You can check progress with CRWriter.savingInProgress().
      • saveReport

        public CRWriter saveReport​(FileType filetype)
        Starts saving the current data to the given filetype.
        Parameters:
        filetype -
        Returns:
        The writer that has started saving in another thread. You can check progress with CRWriter.savingInProgress().
      • quit

        public void quit​(boolean storeSettings)
        This method should be called before the application is terminated in order to store GUI settings etc.
        Parameters:
        storeSettings - store the settings to magellan.ini if storeSettings is true.
      • loadCR

        public GameData loadCR​(UserInterface ui,
                               java.io.File fileName)
        Loads game data from a file and returns it.
        Parameters:
        ui -
        fileName -
        Returns:
        the game data read or null if something went wrong
      • loadCRThread

        public void loadCRThread​(java.io.File fileName)
        This method asynchronously loads a CR into the client. Modality is ensured via a UserInterface.
        Parameters:
        fileName - The file name to be loaded.
      • loadCRThread

        public void loadCRThread​(boolean saveFirst,
                                 java.io.File fileName)
        This method asynchronously loads a CR into the client. Modality is ensured via a UserInterface.
        Parameters:
        saveFirst - If true, this method attempts to first save the current data.
        fileName - The file name to be loaded.
      • setOrigin

        public void setOrigin​(CoordinateID newOrigin)
        Sets the origin of this client's data to newOrigin.
        Parameters:
        newOrigin - The region in the GameData that is going to be the new origin
      • setGirth

        public void setGirth​(BoxTransformer.BBoxes newBorders)
        Sets the girth of the world in all layers.
        Parameters:
        newBorders -
      • setLookAndFeel

        public void setLookAndFeel​(java.lang.String laf)
        Parameters:
        laf -
      • updateLaF

        public void updateLaF()
        DOCUMENT-ME
      • getLookAndFeels

        public java.lang.String[] getLookAndFeels()
        DOCUMENT-ME
      • addFileToHistory

        public void addFileToHistory​(java.io.File f)
        Adds a single file to the file history.
        Parameters:
        f -
      • getMaxFileHistorySize

        public int getMaxFileHistorySize()
        Returns the maximum number of entries in the history of loaded files.
      • setMaxFileHistorySize

        public void setMaxFileHistorySize​(int size)
        Allows to set the maximum number of files appearing in the file history.
        Parameters:
        size -
      • setReportChanged

        public void setReportChanged​(boolean changed)
        Changes to the report state can be done here. Normally, a change is recognized by the following events.
        Parameters:
        changed -
      • isReportChanged

        public boolean isReportChanged()
        Returns true if the report has changed since last save/load.
      • getSelectedRegions

        public java.util.Map<CoordinateID,​Region> getSelectedRegions()
        Get the selected Regions. The returned map can be empty but is never null. This is a wrapper function so we dont need to give away MapperPanel.
      • getLevel

        public int getLevel()
        Get the Level on the mapper Panel. This is a wrapper function so we dont need to give away MapperPanel.
      • getProperties

        public java.util.Properties getProperties()
        Returns the global settings used by Magellan.
      • setData

        public void setData​(GameData newData)
        Sets a new GameData and notifies all game data listeners.
        Parameters:
        newData -
      • getData

        public GameData getData()
        Returns the current GameData.
      • getDispatcher

        public EventDispatcher getDispatcher()
        Returns the current event dispatcher.
      • getBinaryDirectory

        public static java.io.File getBinaryDirectory()
        Returns the directory where the binaries are.
      • getMagellanDirectory

        @Deprecated
        public static java.io.File getMagellanDirectory()
        Deprecated.
        Returns the directory the local copy of Magellan is inside. Usually identical to binDirectory, but can be used to load texts, images and the like from elsewhere.
      • getResourceDirectory

        public static java.io.File getResourceDirectory()
        Returns the directory for the Magellan resources. Usually identical to binDirectory, but can be used to load texts, images and the like from elsewhere.
      • getSettingsDirectory

        public static java.io.File getSettingsDirectory()
        Returns the directory for the Magellan settings.
      • getLogFile

        public static java.io.File getLogFile()
        Returns the value of logFile.
        Returns:
        Returns logFile.
      • getBookmarkManager

        public BookmarkManager getBookmarkManager()
        Returns:
        the BookmarkManager associated with this Client-Object
      • isShowingStatus

        public boolean isShowingStatus()
        Returns true if order status should be shown in title.
      • setShowStatus

        public void setShowStatus​(boolean bool)
        Changes the progress display behaviour.
        Parameters:
        bool - If true, the progress is shown in the window title
      • setAllVisible

        public void setAllVisible​(boolean v)
        Parameters:
        v -
      • repaint

        public void repaint()
        Overrides:
        repaint in class java.awt.Component
        See Also:
        Component.repaint()
      • repaint

        public void repaint​(int millis)
        Repaints all components.
        Parameters:
        millis - maximium time in milliseconds before update
        See Also:
        Component.repaint(long)
      • getShortCuts

        public java.util.Iterator<javax.swing.KeyStroke> getShortCuts()
        Empty because registered directly.
        Specified by:
        getShortCuts in interface ShortcutListener
        Returns:
        Iterator over all short
      • getSelectedObjects

        public SelectionEvent getSelectedObjects()
        Returns all currenty selected objects.
      • getPlugIns

        public java.util.Collection<MagellanPlugIn> getPlugIns()
        Returns a list of all loaded magellan plugins.
      • initPlugIns

        public void initPlugIns()
        This method tries to load all Magellan PlugIns.
      • debug

        public static java.lang.String debug​(java.awt.Component comp)
        Returns a String representing all parts of the component for debugging.
      • initECheckPath

        public static void initECheckPath​(java.util.Properties settings)
        on windows-OS tries to locate the included ECheck.exe and if found save the path into properties
      • handleAbout

        public void handleAbout​(org.simplericity.macify.eawt.ApplicationEvent event)
        Handles mac specific about menu action event
        Specified by:
        handleAbout in interface org.simplericity.macify.eawt.ApplicationListener
        See Also:
        ApplicationListener.handleAbout(org.simplericity.macify.eawt.ApplicationEvent)
      • handleOpenApplication

        public void handleOpenApplication​(org.simplericity.macify.eawt.ApplicationEvent event)
        Handles mac specific open application event (I think, we don't use it)
        Specified by:
        handleOpenApplication in interface org.simplericity.macify.eawt.ApplicationListener
        See Also:
        ApplicationListener.handleOpenApplication(org.simplericity.macify.eawt.ApplicationEvent)
      • handleOpenFile

        public void handleOpenFile​(org.simplericity.macify.eawt.ApplicationEvent event)
        Handles mac specific file open operation (if someone opens a cr in the finder)
        Specified by:
        handleOpenFile in interface org.simplericity.macify.eawt.ApplicationListener
        See Also:
        ApplicationListener.handleOpenFile(org.simplericity.macify.eawt.ApplicationEvent)
      • handlePreferences

        public void handlePreferences​(org.simplericity.macify.eawt.ApplicationEvent event)
        Handles mac specific preferences menu action event
        Specified by:
        handlePreferences in interface org.simplericity.macify.eawt.ApplicationListener
        See Also:
        ApplicationListener.handlePreferences(org.simplericity.macify.eawt.ApplicationEvent)
      • handlePrintFile

        public void handlePrintFile​(org.simplericity.macify.eawt.ApplicationEvent event)
        Handles mac specific print event
        Specified by:
        handlePrintFile in interface org.simplericity.macify.eawt.ApplicationListener
        See Also:
        ApplicationListener.handlePrintFile(org.simplericity.macify.eawt.ApplicationEvent)
      • handleQuit

        public void handleQuit​(org.simplericity.macify.eawt.ApplicationEvent event)
        Handles mac specific quit menu event
        Specified by:
        handleQuit in interface org.simplericity.macify.eawt.ApplicationListener
        See Also:
        ApplicationListener.handleQuit(org.simplericity.macify.eawt.ApplicationEvent)
      • handleReOpenApplication

        public void handleReOpenApplication​(org.simplericity.macify.eawt.ApplicationEvent event)
        Handles a reopen event - what ever that means
        Specified by:
        handleReOpenApplication in interface org.simplericity.macify.eawt.ApplicationListener
        See Also:
        ApplicationListener.handleReOpenApplication(org.simplericity.macify.eawt.ApplicationEvent)
      • setDefaultIconInfo

        public void setDefaultIconInfo()
        Replaces the application icon in a Mac application with the default mac icon of Magellan. This can be used, when the icon was changed (f.e. with the blue circle)
        See Also:
        setAdditionalIconInfo(int)
      • setAdditionalIconInfo

        public void setAdditionalIconInfo​(int data)
        Adds a small hint to the icon (only available on mac os)
      • updateAppIconCaption

        protected void updateAppIconCaption()
        This method updates the app icon based on not confirmed units
      • addInspector

        public void addInspector​(Inspector inspector)
        Adds a new inspector to the taskpanel
      • addInspectorInterceptor

        public void addInspectorInterceptor​(InspectorInterceptor interceptor)
        Adds a new inspector interceptor to the taskpanel inspectors