org.statcato
Class DatasheetTabbedPane
- java.lang.Object
-
- java.awt.Component
-
- java.awt.Container
-
- javax.swing.JComponent
-
- javax.swing.JTabbedPane
-
- org.statcato.DatasheetTabbedPane
-
- All Implemented Interfaces:
- java.awt.event.MouseListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible, javax.swing.SwingConstants
public class DatasheetTabbedPane extends javax.swing.JTabbedPane implements java.awt.event.MouseListener, java.io.SerializableA tabbed pane of SpreadsheetScrollPane objects.- Since:
- 1.0
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Field Summary
-
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
-
-
Constructor Summary
Constructors Constructor and Description DatasheetTabbedPane(Statcato mTab, java.awt.event.MouseListener popupListener)Constructor, given the parent frame and popup listener for this object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidaddDatasheet()Adds a blank spreadsheet to this tabbed pane.voidaddDatasheet(Spreadsheet ThisSpreadsheet)Adds the given spreadsheet object to this tabbed pane.voidaddDatasheet(java.lang.String contents, java.io.File file)Add the given tab-delimited string to a new Datasheet.voidaddDatasheets(DatasheetTabbedPane pane)voidaddTab(java.lang.String title, java.awt.Component component)Adds a tab containing the given component and title to this tabbed pane.voidaddTab(java.lang.String title, java.awt.Component component, javax.swing.Icon extraIcon)Adds a tab containing the given component, title, and icon.intcloseCurrentDatasheet()Prompts to save the current Datasheet if it has been changed and then closes it.intclosePane()Checks if there is any changed tab and if so prompts the user to save file.booleangetChangedStatus()Returns true iff at least one of the datasheets is modified.java.lang.StringgetCurrentTabTitle()Returns the title at the selected tab.voidmouseClicked(java.awt.event.MouseEvent e)voidmouseEntered(java.awt.event.MouseEvent e)voidmouseExited(java.awt.event.MouseEvent e)voidmousePressed(java.awt.event.MouseEvent e)voidmouseReleased(java.awt.event.MouseEvent e)voidresetTabTitles()Resets the tab titles.voidsetChangedStatus()Set the modified status of the current datasheet to changed.voidsetCurrentTabTitle(java.lang.String title)Sets the title of the selected tab.-
Methods inherited from class javax.swing.JTabbedPane
add, add, add, add, add, addChangeListener, addTab, addTab, getAccessibleContext, getBackgroundAt, getBoundsAt, getChangeListeners, getComponentAt, getDisabledIconAt, getDisplayedMnemonicIndexAt, getForegroundAt, getIconAt, getMnemonicAt, getModel, getSelectedComponent, getSelectedIndex, getTabComponentAt, getTabCount, getTabLayoutPolicy, getTabPlacement, getTabRunCount, getTitleAt, getToolTipText, getToolTipTextAt, getUI, getUIClassID, indexAtLocation, indexOfComponent, indexOfTab, indexOfTab, indexOfTabComponent, insertTab, isEnabledAt, remove, remove, removeAll, removeChangeListener, removeTabAt, setBackgroundAt, setComponentAt, setDisabledIconAt, setDisplayedMnemonicIndexAt, setEnabledAt, setForegroundAt, setIconAt, setMnemonicAt, setModel, setSelectedComponent, setSelectedIndex, setTabComponentAt, setTabLayoutPolicy, setTabPlacement, setTitleAt, setToolTipTextAt, 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, getBaseline, getBaselineResizeBehavior, 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, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, 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, setEnabled, 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
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, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, 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, 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, transferFocusBackward, transferFocusUpCycle
-
-
-
-
Constructor Detail
-
DatasheetTabbedPane
public DatasheetTabbedPane(Statcato mTab, java.awt.event.MouseListener popupListener)
Constructor, given the parent frame and popup listener for this object.- Parameters:
mTab- parent framepopupListener- popup mouse listener
-
-
Method Detail
-
addTab
public void addTab(java.lang.String title, java.awt.Component component)Adds a tab containing the given component and title to this tabbed pane.- Overrides:
addTabin classjavax.swing.JTabbedPane- Parameters:
title- string to be displayed at the top of the tabcomponent- component contained in the tab
-
addTab
public void addTab(java.lang.String title, java.awt.Component component, javax.swing.Icon extraIcon)Adds a tab containing the given component, title, and icon.- Parameters:
title- string to be displayed at the top of the tabcomponent- component to be contained in the tabextraIcon- icon to be displayed at the top of the tab
-
addDatasheet
public void addDatasheet()
Adds a blank spreadsheet to this tabbed pane.
-
addDatasheet
public void addDatasheet(java.lang.String contents, java.io.File file)Add the given tab-delimited string to a new Datasheet. If file is not null, the given string represents contents of the given file- Parameters:
contents- a tab-delimited stringfile- file containing contents; null if none
-
addDatasheet
public void addDatasheet(Spreadsheet ThisSpreadsheet)
Adds the given spreadsheet object to this tabbed pane.- Parameters:
ThisSpreadsheet- spreadsheet to be added
-
addDatasheets
public void addDatasheets(DatasheetTabbedPane pane)
-
closeCurrentDatasheet
public int closeCurrentDatasheet()
Prompts to save the current Datasheet if it has been changed and then closes it.- Returns:
- 0 if the current Datasheet is closed successfully and -1 if it is not closed
-
closePane
public int closePane()
Checks if there is any changed tab and if so prompts the user to save file.- Returns:
- 0 if the pane can be closed and 1 if the pane cannot be closed
-
getChangedStatus
public boolean getChangedStatus()
Returns true iff at least one of the datasheets is modified.- Returns:
- true if at least one of the datasheets is modified or false otherwise.
-
setChangedStatus
public void setChangedStatus()
Set the modified status of the current datasheet to changed.
-
setCurrentTabTitle
public void setCurrentTabTitle(java.lang.String title)
Sets the title of the selected tab.- Parameters:
title- string to be displayed on the selected tab
-
resetTabTitles
public void resetTabTitles()
Resets the tab titles.
-
getCurrentTabTitle
public java.lang.String getCurrentTabTitle()
Returns the title at the selected tab.- Returns:
- string displayed as the selected tab title
-
mouseClicked
public void mouseClicked(java.awt.event.MouseEvent e)
- Specified by:
mouseClickedin interfacejava.awt.event.MouseListener
-
mouseEntered
public void mouseEntered(java.awt.event.MouseEvent e)
- Specified by:
mouseEnteredin interfacejava.awt.event.MouseListener
-
mouseExited
public void mouseExited(java.awt.event.MouseEvent e)
- Specified by:
mouseExitedin interfacejava.awt.event.MouseListener
-
mousePressed
public void mousePressed(java.awt.event.MouseEvent e)
- Specified by:
mousePressedin interfacejava.awt.event.MouseListener
-
mouseReleased
public void mouseReleased(java.awt.event.MouseEvent e)
- Specified by:
mouseReleasedin interfacejava.awt.event.MouseListener
-
-
DMelt 3.0 © DataMelt by jWork.ORG