Class InputTrack
java.lang.Object
org.opensourcephysics.display.OSPRuntime.Supported
org.opensourcephysics.cabrillo.tracker.TTrack
org.opensourcephysics.cabrillo.tracker.InputTrack
- All Implemented Interfaces:
PropertyChangeListener
,EventListener
,Drawable
,Interactive
,Measurable
,Trackable
- Direct Known Subclasses:
Protractor
,TapeMeasure
Superclass for Protractor and TapeMeasure, both of which have a clickable
editable interface for changing the value.
- Author:
- hansonr
-
Nested Class Summary
Nested classes/interfaces inherited from class org.opensourcephysics.cabrillo.tracker.TTrack
TTrack.NameDialog, TTrack.StepArray, TTrack.TextLineLabel, TTrack.TrackDecimalField, TTrack.TrackNumberField
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected boolean
protected MouseListener
protected boolean
protected NumberField
protected Ruler
protected JCheckBox
Fields inherited from class org.opensourcephysics.cabrillo.tracker.TTrack
angleField, angleLabel, angleSeparator, attachmentNames, attachments, autoAdvance, autoAdvanceItem, autoTrackerMarking, circleFootprintListener, clearStepsItem, closeButton, colorItem, constantsLoadedFromXML, customNumberFormats, dataBuilderItem, dataDescriptions, dataFrames, dataProp, datasetManager, dataValid, defaultColors, defaultFootprint, deleteStepItem, deleteTrackItem, description, descriptionItem, enabled, fieldBorder, fixedItem, footprint, footprintListener, footprintMenu, footprints, formatAngleMouseListener, formatMouseListener, hint, HINT_STEP_ADDED_OR_REMOVED, HINT_STEPS_SELECTED, initialized, isMarking, keyFrames, labelFont, locked, lockedItem, magField, magLabel, magSeparator, markByDefault, markByDefaultItem, name, nameDialog, nameItem, nextID, NOMAP, NOMAPS, NOVARA, NOVARS, numberFields, partName, points, positionFields, preferredColumnOrder, properties, PROPERTY_TTRACK_COLOR, PROPERTY_TTRACK_DATA, PROPERTY_TTRACK_FOOTPRINT, PROPERTY_TTRACK_FORMAT, PROPERTY_TTRACK_LOCKED, PROPERTY_TTRACK_MASS, PROPERTY_TTRACK_MODELEND, PROPERTY_TTRACK_MODELSTART, PROPERTY_TTRACK_NAME, PROPERTY_TTRACK_STEP, PROPERTY_TTRACK_STEPS, PROPERTY_TTRACK_TEXTCOLUMN, PROPERTY_TTRACK_VISIBLE, refreshDataLater, skippedStepWarningCheckbox, skippedStepWarningDialog, skippedStepWarningOn, skippedStepWarningTextpane, stepLabel, steps, stepSeparator, stepSizeWhenFirstMarked, stepValueLabel, targetIndex, textColumnEntries, textColumnNames, tField, tframe, tLabel, toolbarPointComponents, toolbarTrackComponents, tp, trailLength, trailVisible, trailVisibleItem, tSeparator, ttype, tValueLabel, TYPE_CALIBRATION, TYPE_CIRCLEFITTER, TYPE_COORDAXES, TYPE_LINEPROFILE, TYPE_OFFSETORIGIN, TYPE_PERSPECTIVE, TYPE_POINTMASS, TYPE_PROTRACTOR, TYPE_RGBREGION, TYPE_TAPEMEASURE, TYPE_UNKNOWN, TYPE_VECTOR, viewable, visible, visibleItem, xField, xLabel, xSeparator, xSpinner, yField, yLabel, ySeparator, ySpinner
Fields inherited from interface org.opensourcephysics.media.core.Trackable
PROPERTY_ADJUSTING
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract boolean
protected abstract NumberField
deleteStep
(int n) Overrides TTrack deleteStep method to prevent deletion.protected abstract void
endEditing
(Step step, String rawText) protected int
protected Step
getKeyStep
(Step step) Returns the key step for a given step.protected abstract Rectangle
getLayoutBounds
(Step step) protected Ruler
getRuler()
Gets the Ruler.getStep
(int n) Overrides TTrack getStep method to provide fixedTape behavior.getStep
(TPoint point, TrackerPanel trackerPanel) Gets a step containing a TPoint.protected boolean
isAutoTrackable
(int pointIndex) Determines if the given point index is autotrackable.boolean
Gets the fixed position property.protected void
protected abstract void
refreshStep
(Step step) void
Sets the color.protected void
setEditAction
(Step step, Point pt, String rawText) protected void
setEditing
(boolean edit, Step target, Point pt) Sets the editing flag.protected void
setFixedPosition
(boolean fixed) Sets the fixed property.void
setFontLevel
(int level) Sets the font level.void
setFootprint
(String name) Sets the footprint to the specified choice.protected abstract void
setInputValue
(Step step) protected void
void
setTrackerPanel
(TrackerPanel panel) Install the controlling TrackerPanel for this track (by default, the first TrackerPanel that adds this track to its drawables) and add this track to the panel's specific (outgoing) listener lists so that the track can respond to external changes.void
setTrailVisible
(boolean visible) Overrides TTrack setTrailVisible method to keep trails hidden.protected void
Methods inherited from class org.opensourcephysics.cabrillo.tracker.TTrack
addFixedItem, addFootprint, addListener, addListenerNCF, addPanelEvents, addStepListener, addTextColumn, assembleMenu, autoMarkAt, clearColumns, convertTextToDataColumn, createAllVariables, createStep, createWarningDialog, delete, delete, dispose, draw, erase, erase, finalize, findInteractive, fireStepsChanged, getAllVariables, getAttachmentDescription, getAttachments, getBaseTrackName, getBaseType, getBaseTypeInt, getColor, getCustomFormatPatterns, getData, getData, getDataDescription, getDataName, getDefaultFormatPatterns, getDefaultFormatPatterns, getDescription, getFootprint, getFootprint, getFootprintLength, getFootprintName, getFootprints, getFootprints, getFormatDescMap, getFormatMap, getFormatPatterns, getFormatVariables, getFrameForData, getIcon, getID, getLoader, getMarkedPoint, getMarkingCursor, getMenu, getMenuItems, getMessage, getName, getName, getNameDialog, getNextVisibleStep, getNumberFields, getNumberFieldsForStep, getPlotViews, getPreferredDataOrder, getPreviousVisibleStep, getProperty, getPropertyNames, getSkippedStepWarningDialog, getStepLength, getSteps, getStepSizeWarningDialog, getTableViews, getTargetDescription, getTargetIndex, getTextColumnEntry, getTextColumnNames, getToolbarPointComponents, getToolbarTrackComponents, getTrack, getTrailLength, getValues, getVarDimsImpl, getVarFormatPattern, getVariableDimensions, getVariablesFromFormatterDisplayName, getX, getXMax, getXMin, getY, getYMax, getYMin, initialize, invalidateData, isAttached, isAutoAdvance, isAutoTrackable, isDataValid, isDependent, isEmpty, isEnabled, isFullyAttached, isLocked, isMarkByDefault, isMarking, isMeasured, isStepComplete, isStepVisible, isTrailVisible, isViewable, isVisible, loadAttachmentsFromNames, propertyChange, refreshAttachments, refreshAttachmentsLater, refreshData, refreshData, refreshDecimalSeparators, remark, remark, removeActiveTrack, removeDeleteTrackItem, removeListener, removeListenerNCF, removePanelEvents, removeStepListener, removeTextColumn, renameTextColumn, repaint, repaint, repaintAll, repaintStep, restorePatterns, savePatterns, setActive, setAnglesInRadians, setAutoAdvance, setColorToDefault, setDefaultNameAndColor, setDescription, setEnabled, setFootprint, setFootprints, setFootprints, setFormatPattern, setInitialFormatPatterns, setLocked, setMarkByDefault, setMarking, setName, setProperty, setTargetIndex, setTargetIndex, setTargetIndex, setTextColumnEntry, setTrailLength, setViewable, setVisible, setX, setXY, setY, showAnglePopup, showFormatPopup, toString, updateListenerVisible
Methods inherited from class org.opensourcephysics.display.OSPRuntime.Supported
addListeners, addPropertyChangeListener, addPropertyChangeListener, addPropertyChangeListenerSafely, dispose, firePropertyChange, firePropertyChange, removeListeners, removePropertyChangeListener, removePropertyChangeListener
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.opensourcephysics.display.Interactive
isInteractive
-
Field Details
-
inputField
-
editListener
-
editing
protected boolean editing -
fixedPosition
protected boolean fixedPosition -
ruler
-
rulerCheckbox
-
-
Constructor Details
-
InputTrack
public InputTrack(int type)
-
-
Method Details
-
checkKeyFrame
protected abstract boolean checkKeyFrame() -
createInputField
-
endEditing
-
getLayoutBounds
-
refreshStep
-
setInputValue
-
setTrackerPanel
Description copied from class:TTrack
Install the controlling TrackerPanel for this track (by default, the first TrackerPanel that adds this track to its drawables) and add this track to the panel's specific (outgoing) listener lists so that the track can respond to external changes. This method is overridden to add specific TrackerPanel events for subclasses.- Overrides:
setTrackerPanel
in classTTrack
- Parameters:
panel
- the TrackerPanel
-
setFootprint
Description copied from class:TTrack
Sets the footprint to the specified choice.- Overrides:
setFootprint
in classTTrack
- Parameters:
name
- the name of the desired footprint
-
setColor
Description copied from class:TTrack
Sets the color. -
getStep
Description copied from class:TTrack
Gets a step containing a TPoint. May return null. -
setFontLevel
public void setFontLevel(int level) Description copied from class:TTrack
Sets the font level.- Overrides:
setFontLevel
in classTTrack
- Parameters:
level
- the desired font level
-
getRuler
Gets the Ruler. Subclasses override to return the appropriate Ruler type.- Returns:
- the Ruler
-
setEditAction
-
isFixedPosition
public boolean isFixedPosition()Gets the fixed position property.- Returns:
true
if fixed
-
setFixedPosition
protected void setFixedPosition(boolean fixed) Sets the fixed property. When fixed, it has the same position at all times.- Overrides:
setFixedPosition
in classTTrack
- Parameters:
fixed
-true
to fix
-
setTrailVisible
public void setTrailVisible(boolean visible) Overrides TTrack setTrailVisible method to keep trails hidden.- Overrides:
setTrailVisible
in classTTrack
- Parameters:
visible
- ignored
-
deleteStep
Overrides TTrack deleteStep method to prevent deletion.- Overrides:
deleteStep
in classTTrack
- Parameters:
n
- the frame number- Returns:
- the deleted step
-
getKeyStep
Returns the key step for a given step. The key step defines the positions of the tape ends.- Parameters:
step
- the step- Returns:
- the key step
-
getStep
Overrides TTrack getStep method to provide fixedTape behavior. -
setEditing
Sets the editing flag.- Parameters:
edit
-true
to edit the scaletarget
- the tape or protractor step that handles the edit processpt
- TODO
-
stopEditing
protected void stopEditing() -
mouseClickedAction
-
setMagValue
protected void setMagValue() -
getAttachmentLength
protected int getAttachmentLength()- Overrides:
getAttachmentLength
in classTTrack
-
isAutoTrackable
protected boolean isAutoTrackable(int pointIndex) Determines if the given point index is autotrackable.- Overrides:
isAutoTrackable
in classTTrack
- Parameters:
pointIndex
- the points[] index- Returns:
- true if autotrackable
-