infomat.view.vector
Class IVectorPanel<T extends IVectorIndex>

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 infomat.view.vector.IVectorPanel<T>
All Implemented Interfaces:
java.awt.event.ActionListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible

public class IVectorPanel<T extends IVectorIndex>
extends javax.swing.JPanel
implements java.awt.event.ActionListener

A JPanel that presents the content of a IVector. It gives the user several means of processing the content. There are a number of methods with names beginning with "set" that defines what of these methods are presented.

See Also:
Serialized Form

Nested Class Summary
private  class IVectorPanel.NumberOfItemsPanel
           
 
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
private  SmallButton deselAllB
           
private  boolean fileable
           
private  javax.swing.JFileChooser fileChooser
           
private  java.lang.String fileChooserPath
           
private  int fileType
           
private  java.awt.Font font
           
private  int fontSize
           
private  SmallButton invSelB
           
private  boolean loadable
           
private  SmallButton loadB
           
private  InfomatModel model
           
private  SmallButton normOB
           
private  IVectorPanel.NumberOfItemsPanel numberOfItemsPanel
           
private  boolean orderable
           
private static java.lang.String[] orderActionSelectionNames
           
private static java.lang.String[] orderActionSelectionNamesNoSimilarity
           
private  ActionSelectionPanel orderActionSelectionPanel
           
private  IVector<T> originalVec
           
private  java.util.Vector<IVectorIndexPanel<T>> panelVec
           
private  IObjectGroup restrictionGroup
           
private  SmallButton rmB
           
private  boolean saveable
           
private  SmallButton saveB
           
private  SmallButton selAllB
           
private  boolean selectable
           
private static java.lang.String[] selectionActionSelectionNames
           
private  ActionSelectionPanel selectionActionSelectionPanel
           
private  boolean showValues
           
private  ISimilarity similarity
           
private  Stoplist stoplist
           
private  boolean textFileable
           
private  javax.swing.JFileChooser textFileChooser
           
private  java.lang.String textFileChooserPath
           
private  boolean textLoadable
           
private  SmallButton textLoadB
           
private  boolean textSaveable
           
private  SmallButton textSaveB
           
private  IVector<T> vec
           
 
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
 
Constructor Summary
IVectorPanel(InfomatModel model)
           
IVectorPanel(InfomatModel model, boolean selectable, boolean fileable)
           
IVectorPanel(InfomatModel model, boolean selectable, IObjectGroup restrictionGroup)
           
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
           
 void addIVector(IVector<T> vec)
          Only used in the search-function.
 void changeIVector(IVector<T> vec)
           
 java.awt.Font getFont()
           
 int getFontSize()
           
 IVector<T> getIVector()
           
 boolean getOrderable()
           
private  IVector<T> getOriginalIVector()
           
 java.util.Vector<T> getSelectedIVectorIndexes()
           
protected  ISimilarity getSimilarity()
           
 void initateGraphics()
           
private  void load()
           
private  void putAll()
           
private  void removeObjsFromVec(java.util.Vector<T> rm, IVector<T> vec)
           
 void save()
           
 void setFileable(boolean fileable)
           
private  void setFileChooser()
           
 void setFilePath(java.lang.String filePath)
           
 void setIVector(IVector<T> vec)
           
private  void setIVector(IVector<T> vec, IVector<T> originalVec)
           
 void setLoadSave(boolean loadable, boolean saveable)
           
 void setOrderable(boolean orderable)
           
 void setRestrictionGroup(IObjectGroup restrictionGroup)
           
 void setSelectable(boolean selectable)
           
 void setShowValues(boolean showValues)
           
 void setSimilarity(ISimilarity similarity)
          Only works when the IVectorIndex:es are IObjects.
 void setTextFileable(boolean textFileable)
           
 void setTextFilePath(java.lang.String textFilePath)
           
 void setTextLoadSave(boolean textLoadable, boolean textSaveable)
           
 void setTXTStopFiles(Stoplist stoplist)
           
 void setXMLFiles()
           
private  void showMessage(java.lang.String title, java.lang.String message)
           
 
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, setVisible, 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, 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

model

private InfomatModel model

originalVec

private IVector<T extends IVectorIndex> originalVec

vec

private IVector<T extends IVectorIndex> vec

panelVec

private java.util.Vector<IVectorIndexPanel<T extends IVectorIndex>> panelVec

selectable

private boolean selectable

selAllB

private SmallButton selAllB

deselAllB

private SmallButton deselAllB

invSelB

private SmallButton invSelB

rmB

private SmallButton rmB

fileable

private boolean fileable

loadB

private SmallButton loadB

saveB

private SmallButton saveB

loadable

private boolean loadable

saveable

private boolean saveable

fileChooserPath

private java.lang.String fileChooserPath

fileChooser

private javax.swing.JFileChooser fileChooser

fileType

private int fileType

textFileable

private boolean textFileable

textLoadB

private SmallButton textLoadB

textSaveB

private SmallButton textSaveB

textLoadable

private boolean textLoadable

textSaveable

private boolean textSaveable

textFileChooserPath

private java.lang.String textFileChooserPath

textFileChooser

private javax.swing.JFileChooser textFileChooser

orderable

private boolean orderable

normOB

private SmallButton normOB

orderActionSelectionPanel

private ActionSelectionPanel orderActionSelectionPanel

orderActionSelectionNames

private static java.lang.String[] orderActionSelectionNames

orderActionSelectionNamesNoSimilarity

private static java.lang.String[] orderActionSelectionNamesNoSimilarity

selectionActionSelectionPanel

private ActionSelectionPanel selectionActionSelectionPanel

selectionActionSelectionNames

private static java.lang.String[] selectionActionSelectionNames

numberOfItemsPanel

private IVectorPanel.NumberOfItemsPanel numberOfItemsPanel

showValues

private boolean showValues

stoplist

private Stoplist stoplist

restrictionGroup

private IObjectGroup restrictionGroup

similarity

private ISimilarity similarity

fontSize

private int fontSize

font

private java.awt.Font font
Constructor Detail

IVectorPanel

public IVectorPanel(InfomatModel model)

IVectorPanel

public IVectorPanel(InfomatModel model,
                    boolean selectable,
                    boolean fileable)

IVectorPanel

public IVectorPanel(InfomatModel model,
                    boolean selectable,
                    IObjectGroup restrictionGroup)
Method Detail

setFileChooser

private void setFileChooser()

setXMLFiles

public void setXMLFiles()

setTXTStopFiles

public void setTXTStopFiles(Stoplist stoplist)

setSelectable

public void setSelectable(boolean selectable)

setFileable

public void setFileable(boolean fileable)

setLoadSave

public void setLoadSave(boolean loadable,
                        boolean saveable)

setFilePath

public void setFilePath(java.lang.String filePath)

setTextFileable

public void setTextFileable(boolean textFileable)

setTextLoadSave

public void setTextLoadSave(boolean textLoadable,
                            boolean textSaveable)

setTextFilePath

public void setTextFilePath(java.lang.String textFilePath)

setOrderable

public void setOrderable(boolean orderable)

getOrderable

public boolean getOrderable()

setShowValues

public void setShowValues(boolean showValues)

setRestrictionGroup

public void setRestrictionGroup(IObjectGroup restrictionGroup)

setSimilarity

public void setSimilarity(ISimilarity similarity)
Only works when the IVectorIndex:es are IObjects. (When T is IObject.) Only implemented for SparseISimilarity yet.


getSimilarity

protected ISimilarity getSimilarity()

getFontSize

public int getFontSize()

getFont

public java.awt.Font getFont()
Specified by:
getFont in interface java.awt.MenuContainer
Overrides:
getFont in class java.awt.Component

initateGraphics

public void initateGraphics()

setIVector

public void setIVector(IVector<T> vec)

addIVector

public void addIVector(IVector<T> vec)
Only used in the search-function. Values are not added!


changeIVector

public void changeIVector(IVector<T> vec)

setIVector

private void setIVector(IVector<T> vec,
                        IVector<T> originalVec)

getIVector

public IVector<T> getIVector()

getOriginalIVector

private IVector<T> getOriginalIVector()

putAll

private void putAll()

getSelectedIVectorIndexes

public java.util.Vector<T> getSelectedIVectorIndexes()

removeObjsFromVec

private void removeObjsFromVec(java.util.Vector<T> rm,
                               IVector<T> vec)

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
Specified by:
actionPerformed in interface java.awt.event.ActionListener

load

private void load()

save

public void save()

showMessage

private void showMessage(java.lang.String title,
                         java.lang.String message)