Class TempUnitDialog

  • All Implemented Interfaces:
    java.awt.image.ImageObserver, java.awt.MenuContainer,, javax.accessibility.Accessible, javax.swing.RootPaneContainer, javax.swing.WindowConstants

    public class TempUnitDialog
    extends InternationalizedDialog
    A dialog for creating a Temp Unit
    See Also:
    Serialized Form
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      protected static class  TempUnitDialog.TablessTextArea
      A text area that doesn't lose focus by tab.
      class  TempUnitDialog.TempUnitDialogListener
      Reacts to events.
      • Nested classes/interfaces inherited from class javax.swing.JDialog

      • Nested classes/interfaces inherited from class java.awt.Dialog

        java.awt.Dialog.AccessibleAWTDialog, java.awt.Dialog.ModalExclusionType, java.awt.Dialog.ModalityType
      • 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

      • 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

      Modifier and Type Field Description
      protected boolean approved  
      protected javax.swing.JButton cancel  
      protected javax.swing.JComboBox combatState  
      protected int combatStatus  
      protected java.awt.GridBagConstraints con  
      protected javax.swing.JTextArea descript  
      protected Faction faction  
      protected javax.swing.JCheckBox giveMaintainCost  
      protected javax.swing.JCheckBox giveRecruitCost  
      protected javax.swing.JComboBox group  
      protected javax.swing.JTextField id  
      protected java.awt.GridBagLayout layout  
      protected javax.swing.JButton more  
      protected javax.swing.JPanel moreButtonPanel  
      protected javax.swing.JPanel morePanel  
      protected javax.swing.JTextField name  
      protected java.awt.Container nameCon  
      protected javax.swing.JButton nameGen  
      protected javax.swing.JButton ok  
      protected javax.swing.JTextField order  
      protected Group parentGroup  
      protected java.awt.Component posC  
      protected javax.swing.JTextField recruit  
      protected java.util.Properties settings  
      static java.lang.String SETTINGS_KEY
      settings key for detailed dialog property
      protected javax.swing.JTextField transfer  
      • Fields inherited from class javax.swing.JDialog

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

      • Fields inherited from class java.awt.Component

      • Fields inherited from interface java.awt.image.ImageObserver

      • Fields inherited from interface javax.swing.WindowConstants

    • Constructor Summary

      Constructor Description
      TempUnitDialog​(java.awt.Frame owner, java.awt.Component parent, java.util.Properties settings)
      Creates new TempUnitDialog
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void changeDialog()  
      protected void checkNameGen()  
      int getCombatState()
      Returns the selected combatState or -1 if it is not set.
      java.lang.String getDescript()  
      Faction getFaction()
      Returns the value of faction.
      java.lang.String getGroup()  
      java.lang.String getID()  
      java.lang.String getName()  
      java.lang.String getOrder()  
      Group getParentGroup()
      Returns the value of parentGroup.
      java.lang.String getRecruit()  
      java.lang.String getTransfer()  
      boolean isApproved()
      Returns true if ok button was pressed.
      boolean isGiveMaintainCost()  
      boolean isGiveRecruitCost()  
      protected void quit()  
      protected void saveBounds()  
      protected void saveCostStates()  
      void setCombatState​(int combatStatus)
      Sets the value of combatStatus.
      void setFaction​(Faction faction)
      Sets the value of faction.
      protected void setFocusList​(boolean extended)  
      void setParentGroup​(Group parentGroup)
      Sets the value of parentGroup.
      void setVisible​(boolean b)  
      void show​(java.lang.String newName)
      Shows the dialog without resetting text boxes except name.
      void show​(java.lang.String newID, java.lang.String newName)
      Displays the dialog.
      void updateCombatState()
      This method updates the combobox with the possible combat states and sets the new possible combat state based on the parent unit combat state.
      void updateGroupList()
      This method updates the group data inside the TEMP Unit dialog.
      boolean wasExtendedDialog()  
      • Methods inherited from class javax.swing.JDialog

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

        addNotify, getModalityType, getTitle, hide, isModal, isResizable, isUndecorated, setBackground, setModal, setModalityType, setOpacity, setResizable, setShape, setTitle, setUndecorated, show, toBack
      • 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, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isAutoRequestFocus, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isOpaque, isShowing, isValidateRoot, pack, paint, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeNotify, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setAutoRequestFocus, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImage, setIconImages, setLocation, setLocation, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setType, 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, 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, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, 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
    • Field Detail

      • faction

        protected Faction faction
      • parentGroup

        protected Group parentGroup
      • combatStatus

        protected int combatStatus
      • id

        protected javax.swing.JTextField id
      • name

        protected javax.swing.JTextField name
      • more

        protected javax.swing.JButton more
      • ok

        protected javax.swing.JButton ok
      • cancel

        protected javax.swing.JButton cancel
      • moreButtonPanel

        protected javax.swing.JPanel moreButtonPanel
      • morePanel

        protected javax.swing.JPanel morePanel
      • recruit

        protected javax.swing.JTextField recruit
      • transfer

        protected javax.swing.JTextField transfer
      • descript

        protected javax.swing.JTextArea descript
      • order

        protected javax.swing.JTextField order
      • group

        protected javax.swing.JComboBox group
      • combatState

        protected javax.swing.JComboBox combatState
      • giveRecruitCost

        protected javax.swing.JCheckBox giveRecruitCost
      • giveMaintainCost

        protected javax.swing.JCheckBox giveMaintainCost
      • con

        protected java.awt.GridBagConstraints con
      • layout

        protected java.awt.GridBagLayout layout
      • posC

        protected java.awt.Component posC
      • approved

        protected boolean approved
      • settings

        protected java.util.Properties settings
      • nameGen

        protected javax.swing.JButton nameGen
      • nameCon

        protected java.awt.Container nameCon

        public static final java.lang.String SETTINGS_KEY
        settings key for detailed dialog property
        See Also:
        Constant Field Values
    • Constructor Detail

      • TempUnitDialog

        public TempUnitDialog​(java.awt.Frame owner,
                              java.awt.Component parent,
                              java.util.Properties settings)
        Creates new TempUnitDialog
    • Method Detail

      • setVisible

        public void setVisible​(boolean b)
        setVisible in class java.awt.Dialog
        See Also:
      • saveBounds

        protected void saveBounds()
      • setFocusList

        protected void setFocusList​(boolean extended)
      • show

        public void show​(java.lang.String newID,
                         java.lang.String newName)
        Displays the dialog.
        newID - preset for id text box
        newName - preset for name box
      • show

        public void show​(java.lang.String newName)
        Shows the dialog without resetting text boxes except name.
      • saveCostStates

        protected void saveCostStates()
      • checkNameGen

        protected void checkNameGen()
      • isApproved

        public boolean isApproved()
        Returns true if ok button was pressed.
      • wasExtendedDialog

        public boolean wasExtendedDialog()
        true if the "more" (detailed) view was active.
      • getID

        public java.lang.String getID()
        The value of the id input box
      • getName

        public java.lang.String getName()
        getName in class java.awt.Component
        The value of the name input box
      • getRecruit

        public java.lang.String getRecruit()
        The value of the recruit input box
      • getTransfer

        public java.lang.String getTransfer()
        The value of the transfer input box
      • getOrder

        public java.lang.String getOrder()
        The value of the order input box
      • getGroup

        public java.lang.String getGroup()
        The value of the group input box
      • getDescript

        public java.lang.String getDescript()
        The value of the description input box
      • isGiveRecruitCost

        public boolean isGiveRecruitCost()
        The value of the give recruit silver checkbox
      • isGiveMaintainCost

        public boolean isGiveMaintainCost()
        The value of the give maintenance silver checkbox
      • changeDialog

        protected void changeDialog()
      • getFaction

        public Faction getFaction()
        Returns the value of faction.
        Returns faction.
      • setFaction

        public void setFaction​(Faction faction)
        Sets the value of faction.
        faction - The value for faction.
      • getParentGroup

        public Group getParentGroup()
        Returns the value of parentGroup.
        Returns parentGroup.
      • setParentGroup

        public void setParentGroup​(Group parentGroup)
        Sets the value of parentGroup.
        parentGroup - The value for parentGroup.
      • updateGroupList

        public void updateGroupList()
        This method updates the group data inside the TEMP Unit dialog. It adds all available groups. Then it selecteds the Group of the current unit.
      • setCombatState

        public void setCombatState​(int combatStatus)
        Sets the value of combatStatus.
        combatStatus - The value for combatStatus.
      • getCombatState

        public int getCombatState()
        Returns the selected combatState or -1 if it is not set.
      • updateCombatState

        public void updateCombatState()
        This method updates the combobox with the possible combat states and sets the new possible combat state based on the parent unit combat state.