public class MetadataPane extends JPanel implements ActionListener, Runnable
Modifier and Type | Class and Description |
---|---|
class |
MetadataPane.TablePanel
Helper class to handle the various TablePanels that will be created to
display the attributes of Elements that have no nested Elements
|
class |
MetadataPane.TabPanel
Helper class to make my life easier in the creation and use of tabs
associates a given xml template element and also an optional OMEXMLNode
with a JPanel that represents the content of a tab.
|
JPanel.AccessibleJPanel
JComponent.AccessibleJComponent
Container.AccessibleAWTContainer
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
Modifier and Type | Field and Description |
---|---|
static Color |
ADD_COLOR
The color that signifies a button's operation is to add something.
|
protected Vector |
addItems
A list of external references to be added to the combobox cell editor.
|
protected boolean |
addSave
If true, the save button should be display in each TabPanel.
|
protected File |
currentFile
Holds the currently edited file, or null if none.
|
static ImageIcon |
DATA_BULLET
An icon that signifies metadata is present.
|
static Color |
DELETE_COLOR
The color that signifies a button's operation is to delete something.
|
protected boolean |
editable
Whether or not the user should be able to edit metadata.
|
protected String |
fileID |
boolean |
hasChanged
Signifies that the current file has
changed from the last saved version.
|
BufferedImage[] |
images |
BufferedImage |
img
Holds the first image of a tiff file.
|
Hashtable |
internalDefs
Hashtable containing internal semantic
type defs in current file.
|
protected OMEXMLMetadata |
ms |
static ImageIcon |
NO_DATA_BULLET
An icon that signifies no metadata is present.
|
protected File |
originalTIFF
Holds the original file if it is of TIFF format.
|
protected Vector |
panelList
A list of all TablePanel objects.
|
protected Vector |
panelsWithID
A list of TablePanel objects that have ID attributes.
|
protected boolean |
raw
Whether XML is being displayed in raw form.
|
protected JPanel |
rawPanel
Panel containing raw XML dump.
|
protected JTextArea |
rawText
Text area displaying raw XML.
|
protected BufferedImageReader |
reader
Holds the image reader used to open image or null if none used.
|
protected boolean |
showIDs
Whether or not to display ID attributes.
|
protected JTabbedPane |
tabPane
Pane containing XML tree.
|
protected Vector |
tabPanelList
A list of the TabPanels.
|
static Color |
TEXT_COLOR
The main text color of most things.
|
protected org.openmicroscopy.xml.OMENode |
thisOmeNode
Keeps track of the OMENode being operated on currently.
|
BufferedImage |
thumb
Holds the first image of a tiff file.
|
BufferedImage[] |
thumbs |
protected Hashtable |
tiffDataStore |
protected TemplateParser |
tParse
TemplateParser object.
|
protected static String[] |
TREE_COLUMNS
Defines the names of columns in the TablePanels.
|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
Constructor and Description |
---|
MetadataPane()
Constructs default widget for displaying OME-XML metadata.
|
MetadataPane(File file)
Constructs a pane to display the OME-XML metadata of a
given file.
|
MetadataPane(File file,
boolean save)
Constructs a pane to display the OME-XML metadata of a
given file and with the given save policy.
|
MetadataPane(File file,
boolean save,
boolean editMe)
Constructs a pane to display the OME-XML metadata of a
given file with the given save and editing policy.
|
Modifier and Type | Method and Description |
---|---|
void |
actionPerformed(ActionEvent e)
Handle the "QuickSave" button actions.
|
String |
addTiffData(String xml,
File file) |
void |
askCompanionInstead(File file) |
boolean |
checkOMETiff(File file) |
protected static ImageIcon |
createImageIcon(String path,
String description)
Returns an ImageIcon, or null if the path was invalid.
|
Document |
getDoc()
Retrieves the current document object
describing the whole OMEXMLNode tree.
|
static int |
getKey(int i)
Converts a number into the KeyEvent for that number.
|
org.openmicroscopy.xml.OMENode |
getRoot()
Get the OMENode currently being edited.
|
boolean |
getState()
Tells whether or not the XML has changed due to
user manipulation.
|
static Vector |
getTreePathList(Element e)
Returns a vector of Strings representing the XMLNames of the
template's ancestors in ascending order in the list.
|
static String |
getTreePathName(Element e)
Get a path name for an element in the template.
|
static String |
getTreePathName(Element el,
OMEXMLNode on)
Get a path name for a given OMEXMLNode found in the current
file being edited based on the template.
|
static boolean |
isInCustom(String tagName)
Tests if the given tagname should be
placed under a CustomAttributesNode.
|
static OMEXMLNode |
makeNode(String unknownName,
OMEXMLNode parent)
Return a new node of type specified by unknownName
with the specified parent.
|
void |
merge() |
void |
renderTab(MetadataPane.TabPanel tp)
Fleshes out the GUI of a given TabPanel, adding TablePanels appropriately.
|
void |
reRender()
resets all gui to reflect changes to the node tree
|
void |
run()
Shows or hides the proper subpanes.
|
void |
saveCompanionFile(File file) |
void |
saveFile(File file)
Save to the given file.
|
void |
saveTiffFile(File file) |
void |
saveTiffFile(File file,
String outId) |
boolean |
setOMEXML(File file)
Sets the displayed OME-XML metadata to correspond
to the given OME-XML or OME-TIFF file.
|
protected void |
setOMEXML(org.openmicroscopy.xml.OMENode ome)
Sets the displayed OME-XML metadata.
|
void |
setupTabs()
Sets up the JTabbedPane based on a template, assumes that no OMEXML
file is being compared to the template, so no data will be displayed.
|
void |
setupTabs(org.openmicroscopy.xml.OMENode ome)
sets up the JTabbedPane given an OMENode from an OMEXML file.
|
void |
stateChanged(boolean change)
Sets whether or not the XML has changed due to
user manipulation.
|
void |
storeTiffData(File file) |
void |
tabChange(int i)
changes the selected tab to tab of index i
|
boolean |
testThirdParty(File file) |
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
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, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, 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
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
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, 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, 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, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, 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, transferFocusBackward, transferFocusUpCycle
protected static final String[] TREE_COLUMNS
public static final ImageIcon DATA_BULLET
public static final ImageIcon NO_DATA_BULLET
public static final Color ADD_COLOR
public static final Color DELETE_COLOR
public static final Color TEXT_COLOR
protected JTabbedPane tabPane
protected TemplateParser tParse
protected org.openmicroscopy.xml.OMENode thisOmeNode
protected Vector panelList
protected Vector panelsWithID
protected Vector addItems
protected Vector tabPanelList
public Hashtable internalDefs
public boolean hasChanged
protected boolean addSave
protected boolean editable
protected boolean showIDs
protected File originalTIFF
protected File currentFile
public BufferedImage img
public BufferedImage thumb
public BufferedImage[] images
public BufferedImage[] thumbs
protected BufferedImageReader reader
protected String fileID
protected Hashtable tiffDataStore
protected OMEXMLMetadata ms
protected JPanel rawPanel
protected JTextArea rawText
protected boolean raw
public MetadataPane()
public MetadataPane(File file)
file
- The file to be initially displayed.public MetadataPane(File file, boolean save)
file
- The file to be initially displayed.save
- Whether saving should be allowed.public MetadataPane(File file, boolean save, boolean editMe)
file
- the file to open initiallysave
- whether or not to display the save buttoneditMe
- whether or not the user should be able to edit metadatapublic Document getDoc()
public boolean getState()
public void stateChanged(boolean change)
change
- Has the XML changed?public org.openmicroscopy.xml.OMENode getRoot()
public boolean testThirdParty(File file)
public void askCompanionInstead(File file)
public void saveFile(File file)
public void saveCompanionFile(File file)
public void saveTiffFile(File file)
public void merge()
public void storeTiffData(File file)
public boolean checkOMETiff(File file)
public boolean setOMEXML(File file)
protected void setOMEXML(org.openmicroscopy.xml.OMENode ome)
public void setupTabs()
public void setupTabs(org.openmicroscopy.xml.OMENode ome)
public void renderTab(MetadataPane.TabPanel tp)
public void tabChange(int i)
public void reRender()
public void actionPerformed(ActionEvent e)
actionPerformed
in interface ActionListener
protected static ImageIcon createImageIcon(String path, String description)
public static String getTreePathName(Element e)
public static String getTreePathName(Element el, OMEXMLNode on)
el
- The template element that corresponds to this OMEXMLNode.on
- The OMEXMLNode that we want the path name for.public static boolean isInCustom(String tagName)
public static OMEXMLNode makeNode(String unknownName, OMEXMLNode parent)
unknownName
- The name this new OMEXMLNode should have.parent
- The parent of the new OMEXMLNode. NEVER pass in
a CustomAttributesNode, but rather the parent of that CANode.public static Vector getTreePathList(Element e)
e
- The template element we want the path list for.public static int getKey(int i)
Copyright © 2014 Open Microscopy Environment