|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
org.opensourcephysics.tools.LibraryBrowser
public class LibraryBrowser
A GUI for browsing OSP digital library collections.
| 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 | |
|---|---|
protected javax.swing.JMenuItem |
aboutItem
|
protected static javax.swing.border.Border |
buttonBorder
|
protected static java.lang.String |
collectionFileName
|
protected javax.swing.JMenu |
collectionsMenu
|
protected javax.swing.Action |
commandAction
|
protected javax.swing.JButton |
commandButton
|
protected javax.swing.JTextField |
commandField
|
protected javax.swing.JLabel |
commandLabel
|
protected javax.swing.JMenuItem |
deleteItem
|
protected javax.swing.JButton |
editButton
|
protected javax.swing.JMenuItem |
exitItem
|
protected boolean |
exitOnClose
|
protected javax.swing.JMenuItem |
exportItem
|
protected static javax.swing.JDialog |
externalDialog
|
protected javax.swing.JMenu |
fileMenu
|
protected static javax.swing.JFrame |
frame
|
protected static java.lang.String |
helpBase
|
protected TextFrame |
helpFrame
|
protected javax.swing.JMenuItem |
helpItem
|
protected javax.swing.JMenu |
helpMenu
|
protected static java.lang.String |
helpName
|
protected javax.swing.JTextPane |
htmlAboutPane
|
protected static java.lang.String |
htmlAboutPath
|
protected javax.swing.JScrollPane |
htmlScroller
|
protected boolean |
keyPressed
|
protected Library |
library
|
protected static java.lang.String |
libraryFileName
|
protected javax.swing.JMenuItem |
libraryManagerItem
|
protected java.lang.String |
libraryPath
|
protected java.awt.event.ActionListener |
loadCollectionAction
|
protected javax.swing.JMenuItem |
logItem
|
protected static javax.swing.JMenuBar |
menubar
|
protected javax.swing.JMenuItem |
newItem
|
protected javax.swing.JMenuItem |
openItem
|
protected javax.swing.JMenuItem |
saveAsItem
|
protected javax.swing.JMenuItem |
saveItem
|
protected javax.swing.JTabbedPane |
tabbedPane
|
protected boolean |
textChanged
|
protected javax.swing.JToolBar |
toolbar
|
protected java.beans.PropertyChangeListener |
treePanelListener
|
protected static boolean |
webConnected
|
| Fields inherited from class javax.swing.JComponent |
|---|
accessibleContext, 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 |
|---|
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 | |
|---|---|
void |
addComPADRECollection(java.lang.String path)
Adds a ComPADRE collection with a specified path. |
void |
addOSPLibrary(java.lang.String path)
Adds an OSP-sponsored library with a specified path. |
protected int |
addTab(java.lang.String path,
boolean addToMyLibrary)
Adds a tab displaying collection with a given path. |
protected void |
addToCollections(java.lang.String path)
Adds a collection to this browser's library after prompting the user to assign it a name. |
protected void |
createGUI()
Creates the visible components of this panel. |
protected LibraryTreePanel |
createLibraryTreePanel()
Creates a new empty LibraryTreePanel. |
protected void |
createNewCollection()
Creates a new empty LibraryCollection file. |
boolean |
exit()
Exits this browser. |
protected void |
export(Library library)
Exports a library by saving a clone of this browser's library after the user is prompted to give the clone a descriptive name. |
static LibraryBrowser |
getBrowser()
Gets the shared singleton browser. |
static LibraryBrowser |
getBrowser(javax.swing.JDialog dialog)
Gets the shared singleton browser in a JDialog or, if none, in a shared JFrame. |
protected java.lang.String |
getSavePath()
Returns a path to which a collection or library file can be saved. |
protected LibraryTreePanel |
getSelectedTreePanel()
Gets the selected LibraryTreePanel, if any. |
protected int |
getTabIndexFromPath(java.lang.String path)
Gets the index of the tab associated with a given path. |
protected java.lang.String |
getTabTitle(int index)
Gets the title of the tab at a given index. |
protected java.lang.String |
getTabTitle(java.lang.String path)
Gets the title of the tab associated with a given path. |
java.lang.String |
getTitle()
|
protected LibraryTreePanel |
getTreePanel(int index)
Gets the LibraryTreePanel at a specified tab index. |
protected java.lang.String |
getUniqueName(java.lang.String proposed,
java.lang.String nameToIgnore)
Returns a name that is not a duplicate of an existing name. |
void |
importLibrary(java.lang.String path)
Imports a library with a specified path. |
protected boolean |
isDuplicateName(java.lang.String name,
java.lang.String nameToIgnore)
Determines if a name duplicates an existing name. |
static boolean |
isWebConnected()
Returns true if connected to the web. |
protected void |
loadCollection(java.lang.String path)
Loads the collection with a given path. |
protected LibraryCollection |
loadXML(java.lang.String path)
Loads the collection with a given path. |
static void |
main(java.lang.String[] args)
Entry point when run as an independent application. |
protected void |
open()
Opens a collection file using a file chooser. |
void |
rebuildCollectionsMenu()
Rebuilds the collection menu. |
protected void |
refreshGUI()
Refreshes the GUI, including locale-dependent resources strings. |
protected void |
refreshTabTitle(java.lang.String path,
LibraryCollection collection)
Refreshes the title of a tab based on the properties of a LibraryCollection and the path associated with that collection. |
protected void |
save()
Saves the selected LibraryTreePanel collection. |
protected void |
saveAs()
Saves the current collection as a new file. |
void |
setTitle(java.lang.String title)
|
void |
setVisible(boolean vis)
|
protected void |
showAboutDialog()
Shows the about dialog. |
protected void |
showHelp()
Shows the help frame and displays a help HTML page. |
| 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, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, 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, 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, transferFocusBackward, 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, 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, transferFocusUpCycle |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected static javax.swing.border.Border buttonBorder
protected static java.lang.String libraryFileName
protected static java.lang.String collectionFileName
protected static java.lang.String helpName
protected static java.lang.String helpBase
protected static java.lang.String htmlAboutPath
protected static boolean webConnected
protected static javax.swing.JFrame frame
protected static javax.swing.JDialog externalDialog
protected static javax.swing.JMenuBar menubar
protected Library library
protected java.lang.String libraryPath
protected javax.swing.JToolBar toolbar
protected javax.swing.Action commandAction
protected javax.swing.JLabel commandLabel
protected javax.swing.JTextField commandField
protected javax.swing.JMenu fileMenu
protected javax.swing.JMenu collectionsMenu
protected javax.swing.JMenu helpMenu
protected javax.swing.JMenuItem newItem
protected javax.swing.JMenuItem openItem
protected javax.swing.JMenuItem saveItem
protected javax.swing.JMenuItem saveAsItem
protected javax.swing.JMenuItem exportItem
protected javax.swing.JMenuItem exitItem
protected javax.swing.JMenuItem deleteItem
protected javax.swing.JMenuItem libraryManagerItem
protected javax.swing.JMenuItem aboutItem
protected javax.swing.JMenuItem logItem
protected javax.swing.JMenuItem helpItem
protected javax.swing.JButton commandButton
protected javax.swing.JButton editButton
protected java.awt.event.ActionListener loadCollectionAction
protected boolean exitOnClose
protected javax.swing.JTabbedPane tabbedPane
protected javax.swing.JScrollPane htmlScroller
protected java.beans.PropertyChangeListener treePanelListener
protected boolean keyPressed
protected boolean textChanged
protected TextFrame helpFrame
protected javax.swing.JTextPane htmlAboutPane
| Method Detail |
|---|
public static LibraryBrowser getBrowser()
public static LibraryBrowser getBrowser(javax.swing.JDialog dialog)
dialog - a JDialog (if null, browser is returned in a JFrame)
public static boolean isWebConnected()
public void importLibrary(java.lang.String path)
path - the path to the Library xml filepublic void addOSPLibrary(java.lang.String path)
path - the path to the Library xml filepublic void addComPADRECollection(java.lang.String path)
path - the ComPADRE querypublic void rebuildCollectionsMenu()
protected LibraryTreePanel getSelectedTreePanel()
protected LibraryTreePanel getTreePanel(int index)
index - the tab index
protected java.lang.String getTabTitle(java.lang.String path)
path - the collection path
protected java.lang.String getTabTitle(int index)
index - the tab index
protected int getTabIndexFromPath(java.lang.String path)
path - the collection path
protected void loadCollection(java.lang.String path)
path - the collection pathprotected LibraryCollection loadXML(java.lang.String path)
path - the collection path
protected int addTab(java.lang.String path,
boolean addToMyLibrary)
path - the collection path
protected void refreshTabTitle(java.lang.String path,
LibraryCollection collection)
path - the collection pathcollection - the LibraryCollection itselfprotected void createGUI()
protected void refreshGUI()
public java.lang.String getTitle()
public void setTitle(java.lang.String title)
protected void open()
protected void save()
protected void export(Library library)
library - the library to exportpublic void setVisible(boolean vis)
setVisible in class javax.swing.JComponentpublic boolean exit()
protected void saveAs()
protected java.lang.String getSavePath()
protected void addToCollections(java.lang.String path)
path - the path to the collectionprotected void createNewCollection()
protected java.lang.String getUniqueName(java.lang.String proposed,
java.lang.String nameToIgnore)
proposed - a proposed namenameToIgnore - a name that is ignored when comparing
protected boolean isDuplicateName(java.lang.String name,
java.lang.String nameToIgnore)
name - the proposed namenameToIgnore - a name that is ignored when comparing
protected LibraryTreePanel createLibraryTreePanel()
protected void showAboutDialog()
protected void showHelp()
public static void main(java.lang.String[] args)
args - String[] ignored
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||