类 ArffPanel
java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
weka.gui.arffviewer.ArffPanel
- 所有已实现的接口:
ActionListener
,MouseListener
,ImageObserver
,MenuContainer
,Serializable
,EventListener
,Accessible
,ChangeListener
,Undoable
public class ArffPanel
extends JPanel
implements ActionListener, ChangeListener, MouseListener, Undoable
A Panel representing an ARFF-Table and the associated filename.
- 版本:
- $Revision: 7369 $
- 作者:
- FracPete (fracpete at waikato dot ac dot nz)
- 另请参阅:
-
嵌套类概要
从类继承的嵌套类/接口 javax.swing.JComponent
JComponent.AccessibleJComponent
从类继承的嵌套类/接口 java.awt.Component
Component.BaselineResizeBehavior
-
字段概要
字段从类继承的字段 javax.swing.JComponent
TOOL_TIP_TEXT_KEY, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
从类继承的字段 java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
从接口继承的字段 java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明void
invoked when an action occursvoid
Adds a ChangeListener to the panelvoid
adds the current state of the instances to the undolistvoid
sets the current attribute as class attribute, i.e.boolean
canUndo()
returns whether an undo is possiblevoid
clears the search, i.e.void
removes the undo historyvoid
copies the content of the selection to the clipboardvoid
deletes the currently selected attributevoid
deletes the chosen attributesvoid
deletes the currently selected instancevoid
deletes all the currently selected instancesreturns a list with the attributesreturns the filenamereturns the instances of the panel, if none then NULLgetTable()
returns the table componentgetTitle()
returns the title for the Tab, i.e.boolean
returns whether the content of the panel was changedboolean
returns whether the model is read-onlyboolean
returns whether undo support is enabledvoid
Invoked when a mouse button has been pressed and released on a componentvoid
Invoked when the mouse enters a component.void
Invoked when the mouse exits a componentvoid
Invoked when a mouse button has been pressed on a componentvoid
Invoked when a mouse button has been released on a component.void
notfies all listener of the changevoid
Removes a ChangeListener from the panelvoid
renames the current attributevoid
search()
searches for a string in the cellsvoid
setChanged
(boolean changed) can only reset the changed state to FALSEvoid
setFilename
(String filename) sets the filenamevoid
setInstances
(Instances data) displays the given instances, i.e.void
calculates the optimal column width for the current columnvoid
calculates the optimal column widths for all columnsvoid
setReadOnly
(boolean value) sets whether the model is read-onlyvoid
setUndoEnabled
(boolean enabled) sets whether undo support is enabledvoid
sorts the instances via the currently selected columnvoid
Invoked when the target of the listener has changed its state.void
undo()
performs an undo action从类继承的方法 javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, setUI, updateUI
从类继承的方法 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, 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
从类继承的方法 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, transferFocusDownCycle, validate
从类继承的方法 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, 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, 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
-
字段详细资料
-
TAB_INSTANCES
the name of the tab for instances that were set directly
-
-
构造器详细资料
-
ArffPanel
public ArffPanel()initializes the panel with no data -
ArffPanel
initializes the panel and loads the specified file- 参数:
filename
- the file to load
-
ArffPanel
initializes the panel with the given data- 参数:
data
- the data to use
-
-
方法详细资料
-
getTable
returns the table component- 返回:
- the table
-
getTitle
returns the title for the Tab, i.e. the filename- 返回:
- the title for the tab
-
getFilename
returns the filename- 返回:
- the filename
-
setFilename
sets the filename- 参数:
filename
- the new filename
-
getInstances
returns the instances of the panel, if none then NULL- 返回:
- the instances of the panel
-
setInstances
displays the given instances, i.e. creates a tab with the title TAB_INSTANCES. if one already exists it closes it.
if a different instances object is used here, don't forget to clear the undo-history by callingclearUndo()
- 参数:
data
- the instances to display- 另请参阅:
-
getAttributes
returns a list with the attributes- 返回:
- a list of the attributes
-
setChanged
public void setChanged(boolean changed) can only reset the changed state to FALSE- 参数:
changed
- if false, resets the changed state
-
isChanged
public boolean isChanged()returns whether the content of the panel was changed- 返回:
- true if the content was changed
-
isReadOnly
public boolean isReadOnly()returns whether the model is read-only- 返回:
- true if model is read-only
-
setReadOnly
public void setReadOnly(boolean value) sets whether the model is read-only- 参数:
value
- if true the model is set to read-only
-
isUndoEnabled
public boolean isUndoEnabled()returns whether undo support is enabled- 指定者:
isUndoEnabled
在接口中Undoable
- 返回:
- true if undo is enabled
-
setUndoEnabled
public void setUndoEnabled(boolean enabled) sets whether undo support is enabled- 指定者:
setUndoEnabled
在接口中Undoable
- 参数:
enabled
- whether to enable/disable undo support
-
clearUndo
public void clearUndo()removes the undo history -
canUndo
public boolean canUndo()returns whether an undo is possible -
undo
public void undo()performs an undo action -
addUndoPoint
public void addUndoPoint()adds the current state of the instances to the undolist- 指定者:
addUndoPoint
在接口中Undoable
-
deleteAttribute
public void deleteAttribute()deletes the currently selected attribute -
deleteAttributes
public void deleteAttributes()deletes the chosen attributes -
attributeAsClass
public void attributeAsClass()sets the current attribute as class attribute, i.e. it moves it to the end of the attributes -
renameAttribute
public void renameAttribute()renames the current attribute -
deleteInstance
public void deleteInstance()deletes the currently selected instance -
deleteInstances
public void deleteInstances()deletes all the currently selected instances -
sortInstances
public void sortInstances()sorts the instances via the currently selected column -
copyContent
public void copyContent()copies the content of the selection to the clipboard -
search
public void search()searches for a string in the cells -
clearSearch
public void clearSearch()clears the search, i.e. resets the found cells -
setOptimalColWidth
public void setOptimalColWidth()calculates the optimal column width for the current column -
setOptimalColWidths
public void setOptimalColWidths()calculates the optimal column widths for all columns -
actionPerformed
invoked when an action occurs- 指定者:
actionPerformed
在接口中ActionListener
- 参数:
e
- the action event
-
mouseClicked
Invoked when a mouse button has been pressed and released on a component- 指定者:
mouseClicked
在接口中MouseListener
- 参数:
e
- the mouse event
-
mouseEntered
Invoked when the mouse enters a component.- 指定者:
mouseEntered
在接口中MouseListener
- 参数:
e
- the mouse event
-
mouseExited
Invoked when the mouse exits a component- 指定者:
mouseExited
在接口中MouseListener
- 参数:
e
- the mouse event
-
mousePressed
Invoked when a mouse button has been pressed on a component- 指定者:
mousePressed
在接口中MouseListener
- 参数:
e
- the mouse event
-
mouseReleased
Invoked when a mouse button has been released on a component.- 指定者:
mouseReleased
在接口中MouseListener
- 参数:
e
- the mouse event
-
stateChanged
Invoked when the target of the listener has changed its state.- 指定者:
stateChanged
在接口中ChangeListener
- 参数:
e
- the change event
-
notifyListener
public void notifyListener()notfies all listener of the change -
addChangeListener
Adds a ChangeListener to the panel- 参数:
l
- the listener to add
-
removeChangeListener
Removes a ChangeListener from the panel- 参数:
l
- the listener to remove
-