Class DetailedCellInfo

  • All Implemented Interfaces:
    java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible

    public class DetailedCellInfo
    extends javax.swing.JPanel
    This class holds and displays detailed cell info for Physical layer
    See Also:
    Serialized Form
    • Nested Class Summary

      • Nested classes/interfaces inherited from class javax.swing.JPanel

        javax.swing.JPanel.AccessibleJPanel
      • Nested classes/interfaces inherited from class javax.swing.JComponent

        javax.swing.JComponent.AccessibleJComponent
      • 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
      private LevelEditor editor  
      private int i  
      private int j  
      private java.util.LinkedList<javax.swing.JRadioButton> radioButtons  
      private java.util.LinkedList<javax.swing.JTextField> textFields  
      • Fields inherited from class javax.swing.JComponent

        listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
      • Fields inherited from class java.awt.Component

        accessibleContext, 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
    • Method Summary

      Modifier and Type Method Description
      private void directionInfo​(int offset)
      Displays set of four radio buttons for direction selection
      void displayDetailedCellInfo​(java.lang.String type)
      Displays detailed info based on the type of cell provided
      private void fieldInfo​(java.lang.String title, java.lang.String fieldName, int offset)
      Displays one text field with a name
      java.lang.String getCellInfo​(java.lang.String type)
      Saves all attributes from menu into text
      private java.lang.String getDirectionInfo()
      Saves direction info as text
      private java.lang.String getDoorInfo​(java.lang.String type)
      Changes type of cell based on direction value
      private java.lang.String getFieldInfo​(java.lang.String fieldName, boolean isRequired)
      Saves field value
      private java.lang.String getFieldIntegerInfo​(java.lang.String fieldName)
      Checks id field value is an integer and saves it
      private java.lang.String getLockedInfo()
      Saves if door is supposed to be locked
      private java.lang.String getTrueFalseInfo​(java.lang.String trueLabel, java.lang.String falseLabel)
      Saves true/false value as text
      private java.lang.String getUpperLowerInfo()
      Checks if a block is supposed to be half-block
      private java.lang.String getVisibleInfo​(java.lang.String type)
      Changes type of cell based on visibility value
      private void setDirectionInfo​(java.lang.String value)
      Parses value and checks corresponding button
      private void setFieldInfo​(java.lang.String fieldName, java.lang.String value)
      Fills a selected field with value
      private void setInfo()
      Loads cell info into fields
      private void setTrueFalseInfo​(java.lang.String value)
      Parses value and checks corresponding button
      private void setUpperLowerInfo​(java.lang.String value)
      Parses value and checks corresponding button
      private void trueFalseInfo​(java.lang.String title, java.lang.String trueLabel, java.lang.String falseLabel, int offset)
      Displays set of radio buttons for true/false selection
      private void upperLowerInfo()
      Displays set of three radio buttons for selection
      • Methods inherited from class javax.swing.JPanel

        getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
      • Methods inherited from class javax.swing.JComponent

        addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintComponent, paintChildren, paintImmediately, paintImmediately, print, printAll, printBorder, printComponent, printChildren, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
      • Methods inherited from class java.awt.Container

        add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree
      • Methods inherited from class java.awt.Component

        action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, checkImage, checkImage, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, 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

      • radioButtons

        private java.util.LinkedList<javax.swing.JRadioButton> radioButtons
      • textFields

        private java.util.LinkedList<javax.swing.JTextField> textFields
      • i

        private int i
      • j

        private int j
    • Constructor Detail

      • DetailedCellInfo

        public DetailedCellInfo​(LevelEditor editor,
                                int i,
                                int j)
    • Method Detail

      • displayDetailedCellInfo

        public void displayDetailedCellInfo​(java.lang.String type)
        Displays detailed info based on the type of cell provided
        Parameters:
        type - is type of cell
      • trueFalseInfo

        private void trueFalseInfo​(java.lang.String title,
                                   java.lang.String trueLabel,
                                   java.lang.String falseLabel,
                                   int offset)
        Displays set of radio buttons for true/false selection
        Parameters:
        title - is tile of this field
        trueLabel - is true value
        falseLabel - is false value
        offset - is offset from top of menu
      • fieldInfo

        private void fieldInfo​(java.lang.String title,
                               java.lang.String fieldName,
                               int offset)
        Displays one text field with a name
        Parameters:
        title - is tile of this field
        fieldName - is name of text field
        offset - is offset from top of menu
      • upperLowerInfo

        private void upperLowerInfo()
        Displays set of three radio buttons for selection
      • directionInfo

        private void directionInfo​(int offset)
        Displays set of four radio buttons for direction selection
        Parameters:
        offset - is offset from top of menu
      • getCellInfo

        public java.lang.String getCellInfo​(java.lang.String type)
        Saves all attributes from menu into text
        Parameters:
        type - type of cell
        Returns:
        cell value as it would be in a text file
      • getVisibleInfo

        private java.lang.String getVisibleInfo​(java.lang.String type)
        Changes type of cell based on visibility value
        Parameters:
        type - type of cell
        Returns:
        changed type of cell
      • getUpperLowerInfo

        private java.lang.String getUpperLowerInfo()
        Checks if a block is supposed to be half-block
        Returns:
        text to determine if block is half-block
      • getFieldInfo

        private java.lang.String getFieldInfo​(java.lang.String fieldName,
                                              boolean isRequired)
        Saves field value
        Parameters:
        fieldName - name of field to be saved
        isRequired - is this field required to be filled in
        Returns:
        value form field
      • getFieldIntegerInfo

        private java.lang.String getFieldIntegerInfo​(java.lang.String fieldName)
        Checks id field value is an integer and saves it
        Parameters:
        fieldName - name of field to be saved
        Returns:
        value form field
      • getTrueFalseInfo

        private java.lang.String getTrueFalseInfo​(java.lang.String trueLabel,
                                                  java.lang.String falseLabel)
        Saves true/false value as text
        Parameters:
        trueLabel - is name of true button
        falseLabel - is name of false button
        Returns:
        text representation
      • getDirectionInfo

        private java.lang.String getDirectionInfo()
        Saves direction info as text
        Returns:
        text representation of direction
      • getDoorInfo

        private java.lang.String getDoorInfo​(java.lang.String type)
        Changes type of cell based on direction value
        Parameters:
        type - type of cell
        Returns:
        changed type of cell
      • getLockedInfo

        private java.lang.String getLockedInfo()
        Saves if door is supposed to be locked
        Returns:
        text representation
      • setInfo

        private void setInfo()
        Loads cell info into fields
      • setTrueFalseInfo

        private void setTrueFalseInfo​(java.lang.String value)
        Parses value and checks corresponding button
        Parameters:
        value - is text true/false value
      • setUpperLowerInfo

        private void setUpperLowerInfo​(java.lang.String value)
        Parses value and checks corresponding button
        Parameters:
        value - is text half-block value
      • setFieldInfo

        private void setFieldInfo​(java.lang.String fieldName,
                                  java.lang.String value)
        Fills a selected field with value
        Parameters:
        fieldName - is name of field to be filled in
        value - is new value of field
      • setDirectionInfo

        private void setDirectionInfo​(java.lang.String value)
        Parses value and checks corresponding button
        Parameters:
        value - is text direction value