org.eml.MMAX2.gui.windows
Class MMAX2AttributePanel

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by org.eml.MMAX2.gui.windows.MMAX2AttributePanel
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible

public class MMAX2AttributePanel
extends javax.swing.JPanel

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Field Summary
 Markable currentMarkable
           
 boolean hasUncommittedChanges
          Indicates if the currently loaded annotation contains unsaved changes.
 java.util.ArrayList keepables
           
 java.util.ArrayList lastValidAttributes
           
static java.lang.String MMAXDataPath
          Indicates the absolute path to the directory in which the .anno file resides.
 javax.swing.JPanel modifiablePanel
          This field holds a clone of the currently displayed Markable with its values unchanged by any attribute window manipulations that occured since it was selected by the user.
 MMAX2AnnotationScheme scheme
           
 javax.swing.JCheckBox suppressCheck
           
 javax.swing.JCheckBox warnOnExtraAttributes
           
 
Fields inherited from class javax.swing.JComponent
TOOL_TIP_TEXT_KEY, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
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
 
Constructor Summary
MMAX2AttributePanel(MMAX2AnnotationScheme _scheme)
           
 
Method Summary
 void addAttributes(MMAX2Attribute[] attributes)
           
 void addAttributesAfter(MMAX2Attribute[] attributes, MMAX2Attribute leader)
           
 void create()
          This method creates an attribute window from the given schemefile.
 void displayInitComplete()
          This method is called by the main application to inform the AttributeWindow that the display has been built.
 void displayMarkableAttributes(Markable markable)
          This method displays the attributes of the supplied markable, by retrieving from the underlying AnnotationScheme the correct MMAX2Attribute objects.
 java.util.ArrayList getAllAttributes()
          This method returns an ArrayList of all attributes defined in the schemefile This method is called in the context of Kappa calculation.
 java.util.ArrayList getAllCurrentAttributes()
          Returns an ArrayList of all MMAX2Attribute objects currently displayed on this panel, incl.
 java.lang.String[] getAllNominalMMAX2AttributeNames()
           
 java.util.HashMap getAttributeValuePairs()
          This method returns a hashmap representing a 'snapshot' of the currently displayed attributes and their values.
 MMAX2AttributePanelContainer getContainer()
           
 MMAX2Attribute getLastAttribute()
           
 java.lang.String getOneClickAnnotationAttributeName()
           
 javax.swing.JScrollPane getScrollPane()
           
 void rebuild()
           
 void removeAllAttributes()
           
 MMAX2Attribute[] removeTrailingDependentAttributes(MMAX2Attribute lastAttribute)
          Removes and returns MMAX2Attributes dependent on lastAttribute, or empty list.
 void setApplyEnabled(boolean status)
           
 void setAttributePanelContainer(MMAX2AttributePanelContainer _container)
           
 void setEnabled(boolean status)
           
 void setHasUncommittedChanges(boolean newStatus)
          This method is called from the main application if the dirty status of the annotation changes.
 void setMarkableAttributes(Markable markable, boolean rerender)
          This method applies the attributes and values which are currently displayed in the AttributeWindow to Markable markable.
 void setOneClickAnnotationAttributeName(java.lang.String _name)
           
 void setScrollPane(javax.swing.JScrollPane _pane)
           
 void setUndoEnabled(boolean status)
           
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, 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, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintImmediately, paintImmediately, print, printAll, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, 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, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, createImage, createImage, createVolatileImage, createVolatileImage, dispatchEvent, enable, enableInputMethods, 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, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, 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, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

scheme

public MMAX2AnnotationScheme scheme

suppressCheck

public javax.swing.JCheckBox suppressCheck

warnOnExtraAttributes

public javax.swing.JCheckBox warnOnExtraAttributes

currentMarkable

public Markable currentMarkable

lastValidAttributes

public java.util.ArrayList lastValidAttributes

keepables

public java.util.ArrayList keepables

hasUncommittedChanges

public boolean hasUncommittedChanges
Indicates if the currently loaded annotation contains unsaved changes. This field must be set by the attribute window's setDirty(value) method, which is called by the main application whenever changes to the annotation occur. It is read by the main application when the user tries to close the application in order to determine if the user has to be prompted for saving. Therefore, make sure to set this field to TRUE whenever permanent changes to the annotation (i.e. Markable's attributes) occurr!


MMAXDataPath

public static java.lang.String MMAXDataPath
Indicates the absolute path to the directory in which the .anno file resides. This path is needed to access the scheme file in the .create() method. DO NOT MODIFY!


modifiablePanel

public javax.swing.JPanel modifiablePanel
This field holds a clone of the currently displayed Markable with its values unchanged by any attribute window manipulations that occured since it was selected by the user. Use this field to implement attribute manipulation undo. Attributes of type ID (i.e. Member and Pointer) are removed from this clone directly after creation. They are not needed for undo functionality, because attributes of type ID are NEVER altered through AttributeWindow interaction.

Constructor Detail

MMAX2AttributePanel

public MMAX2AttributePanel(MMAX2AnnotationScheme _scheme)
Method Detail

setScrollPane

public final void setScrollPane(javax.swing.JScrollPane _pane)

getScrollPane

public final javax.swing.JScrollPane getScrollPane()

setAttributePanelContainer

public final void setAttributePanelContainer(MMAX2AttributePanelContainer _container)

setOneClickAnnotationAttributeName

public final void setOneClickAnnotationAttributeName(java.lang.String _name)

getOneClickAnnotationAttributeName

public final java.lang.String getOneClickAnnotationAttributeName()

setHasUncommittedChanges

public final void setHasUncommittedChanges(boolean newStatus)
This method is called from the main application if the dirty status of the annotation changes. The implementing method must set the value of the Dirty field (as defined in PluggableAttributeWindow) appropriately. In addition, measures must be implemented to inform the user on the current status. Note: The AttributeWindow must also call MMAX.setSaveButtonEnabled(newStatus), in order for the save button in the MMAX file menu to reflect the current dirty status !!


getAllAttributes

public final java.util.ArrayList getAllAttributes()
This method returns an ArrayList of all attributes defined in the schemefile This method is called in the context of Kappa calculation.


displayInitComplete

public void displayInitComplete()
This method is called by the main application to inform the AttributeWindow that the display has been built. This method can implement any changes it wants to make to the display, e.g. in terms of markable colouring.


create

public final void create()
This method creates an attribute window from the given schemefile.


setEnabled

public final void setEnabled(boolean status)
Overrides:
setEnabled in class javax.swing.JComponent

getAllNominalMMAX2AttributeNames

public final java.lang.String[] getAllNominalMMAX2AttributeNames()

displayMarkableAttributes

public final void displayMarkableAttributes(Markable markable)
This method displays the attributes of the supplied markable, by retrieving from the underlying AnnotationScheme the correct MMAX2Attribute objects. This method is called whenever a Markable gets selected in the MMAX display.


getAttributeValuePairs

public final java.util.HashMap getAttributeValuePairs()
This method returns a hashmap representing a 'snapshot' of the currently displayed attributes and their values. Attribute-Value pairs for attributes of type ID are NOT contained in this snapshot, because they cannot be modified via the AttributeWindow GUI. New: Relations are returned as well Both attribute and value strings are set to lowercase


getAllCurrentAttributes

public final java.util.ArrayList getAllCurrentAttributes()
Returns an ArrayList of all MMAX2Attribute objects currently displayed on this panel, incl. member and pointer.


setMarkableAttributes

public final void setMarkableAttributes(Markable markable,
                                        boolean rerender)
This method applies the attributes and values which are currently displayed in the AttributeWindow to Markable markable. It does so by creating a new Attributes HashMap, filling it with the displayed attributes and values, and assigning it to markable. Values of ID-type attributes member and pointer are not changed. When this method is called, BackupMarkable can be ignored.


removeAllAttributes

public final void removeAllAttributes()

addAttributes

public final void addAttributes(MMAX2Attribute[] attributes)

addAttributesAfter

public final void addAttributesAfter(MMAX2Attribute[] attributes,
                                     MMAX2Attribute leader)

getLastAttribute

public final MMAX2Attribute getLastAttribute()

removeTrailingDependentAttributes

public final MMAX2Attribute[] removeTrailingDependentAttributes(MMAX2Attribute lastAttribute)
Removes and returns MMAX2Attributes dependent on lastAttribute, or empty list.


rebuild

public final void rebuild()

setApplyEnabled

public final void setApplyEnabled(boolean status)

setUndoEnabled

public final void setUndoEnabled(boolean status)

getContainer

public final MMAX2AttributePanelContainer getContainer()