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 booleanprotected MouseListenerprotected booleanprotected NumberFieldprotected Rulerprotected JCheckBoxFields 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, ySpinnerFields inherited from interface org.opensourcephysics.media.core.Trackable
PROPERTY_ADJUSTING -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract booleanprotected abstract NumberFielddeleteStep(int n) Overrides TTrack deleteStep method to prevent deletion.protected abstract voidendEditing(Step step, String rawText) protected intprotected StepgetKeyStep(Step step) Returns the key step for a given step.protected abstract RectanglegetLayoutBounds(Step step) protected RulergetRuler()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 booleanisAutoTrackable(int pointIndex) Determines if the given point index is autotrackable.booleanGets the fixed position property.protected voidprotected abstract voidrefreshStep(Step step) voidSets the color.protected voidsetEditAction(Step step, Point pt, String rawText) protected voidsetEditing(boolean edit, Step target, Point pt) Sets the editing flag.protected voidsetFixedPosition(boolean fixed) Sets the fixed property.voidsetFontLevel(int level) Sets the font level.voidsetFootprint(String name) Sets the footprint to the specified choice.protected abstract voidsetInputValue(Step step) protected voidvoidsetTrackerPanel(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.voidsetTrailVisible(boolean visible) Overrides TTrack setTrailVisible method to keep trails hidden.protected voidMethods 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, updateListenerVisibleMethods inherited from class org.opensourcephysics.display.OSPRuntime.Supported
addListeners, addPropertyChangeListener, addPropertyChangeListener, addPropertyChangeListenerSafely, dispose, firePropertyChange, firePropertyChange, removeListeners, removePropertyChangeListener, removePropertyChangeListenerMethods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods 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:TTrackInstall 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:
setTrackerPanelin classTTrack- Parameters:
panel- the TrackerPanel
-
setFootprint
Description copied from class:TTrackSets the footprint to the specified choice.- Overrides:
setFootprintin classTTrack- Parameters:
name- the name of the desired footprint
-
setColor
Description copied from class:TTrackSets the color. -
getStep
Description copied from class:TTrackGets a step containing a TPoint. May return null. -
setFontLevel
public void setFontLevel(int level) Description copied from class:TTrackSets the font level.- Overrides:
setFontLevelin 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:
trueif fixed
-
setFixedPosition
protected void setFixedPosition(boolean fixed) Sets the fixed property. When fixed, it has the same position at all times.- Overrides:
setFixedPositionin classTTrack- Parameters:
fixed-trueto fix
-
setTrailVisible
public void setTrailVisible(boolean visible) Overrides TTrack setTrailVisible method to keep trails hidden.- Overrides:
setTrailVisiblein classTTrack- Parameters:
visible- ignored
-
deleteStep
Overrides TTrack deleteStep method to prevent deletion.- Overrides:
deleteStepin 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-trueto 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:
getAttachmentLengthin classTTrack
-
isAutoTrackable
protected boolean isAutoTrackable(int pointIndex) Determines if the given point index is autotrackable.- Overrides:
isAutoTrackablein classTTrack- Parameters:
pointIndex- the points[] index- Returns:
- true if autotrackable
-