Class DetailedCellInfo
- java.lang.Object
-
- java.awt.Component
-
- java.awt.Container
-
- javax.swing.JComponent
-
- javax.swing.JPanel
-
- ruscz.game.gameOfProd.LevelEditor.DetailedCellInfo
-
- All Implemented Interfaces:
java.awt.image.ImageObserver,java.awt.MenuContainer,java.io.Serializable,javax.accessibility.Accessible
public class DetailedCellInfo extends javax.swing.JPanelThis 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
-
-
Field Summary
Fields Modifier and Type Field Description private LevelEditoreditorprivate intiprivate intjprivate java.util.LinkedList<javax.swing.JRadioButton>radioButtonsprivate 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
-
-
Constructor Summary
Constructors Constructor Description DetailedCellInfo(LevelEditor editor, int i, int j)
-
Method Summary
Modifier and Type Method Description private voiddirectionInfo(int offset)Displays set of four radio buttons for direction selectionvoiddisplayDetailedCellInfo(java.lang.String type)Displays detailed info based on the type of cell providedprivate voidfieldInfo(java.lang.String title, java.lang.String fieldName, int offset)Displays one text field with a namejava.lang.StringgetCellInfo(java.lang.String type)Saves all attributes from menu into textprivate java.lang.StringgetDirectionInfo()Saves direction info as textprivate java.lang.StringgetDoorInfo(java.lang.String type)Changes type of cell based on direction valueprivate java.lang.StringgetFieldInfo(java.lang.String fieldName, boolean isRequired)Saves field valueprivate java.lang.StringgetFieldIntegerInfo(java.lang.String fieldName)Checks id field value is an integer and saves itprivate java.lang.StringgetLockedInfo()Saves if door is supposed to be lockedprivate java.lang.StringgetTrueFalseInfo(java.lang.String trueLabel, java.lang.String falseLabel)Saves true/false value as textprivate java.lang.StringgetUpperLowerInfo()Checks if a block is supposed to be half-blockprivate java.lang.StringgetVisibleInfo(java.lang.String type)Changes type of cell based on visibility valueprivate voidsetDirectionInfo(java.lang.String value)Parses value and checks corresponding buttonprivate voidsetFieldInfo(java.lang.String fieldName, java.lang.String value)Fills a selected field with valueprivate voidsetInfo()Loads cell info into fieldsprivate voidsetTrueFalseInfo(java.lang.String value)Parses value and checks corresponding buttonprivate voidsetUpperLowerInfo(java.lang.String value)Parses value and checks corresponding buttonprivate voidtrueFalseInfo(java.lang.String title, java.lang.String trueLabel, java.lang.String falseLabel, int offset)Displays set of radio buttons for true/false selectionprivate voidupperLowerInfo()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
-
-
-
-
Field Detail
-
radioButtons
private java.util.LinkedList<javax.swing.JRadioButton> radioButtons
-
textFields
private java.util.LinkedList<javax.swing.JTextField> textFields
-
editor
private LevelEditor editor
-
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 fieldtrueLabel- is true valuefalseLabel- is false valueoffset- 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 fieldfieldName- is name of text fieldoffset- 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 savedisRequired- 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 buttonfalseLabel- 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 invalue- 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
-
-