de.pxlab.pxl
Class Display

java.lang.Object
  extended by de.pxlab.pxl.DisplaySupport
      extended by de.pxlab.pxl.Display
All Implemented Interfaces:
ExParTypeCodes, TimerBitCodes, Topics
Direct Known Subclasses:
AdditiveColorMixer, AdelsonPattern, AdelsonPattern2, AfterEffect, AfterEffectImage, ApparentMotion, Arrow, Assimilation, Beep, BinaryRandomDotMatrix, BitMapMatrix, BrightnessContrastInduction, BrightnessInduction, Chevron, ChoiceResponse, CIELabPlane, CIELabSelection, ClearScreen, CmdMessage, ColorAdjustableHSB, ColorCircleSelection, ColorContrast, ColorDiscrimination, ColoredLine, ColoredShadows, ColorFile, ColorMeasurement, ColorSampleSelection, ColorSpectrum, ColorStripes, ConditionalWaitResponse, ConvexMixturePattern, Cornsweet, CountDown, CrispeningEffect, CrossContext3DMatching, CrossContextMatching, CrossContextMatchingMixed, DarkAxes, Desaturation, DeuteranopicConfusionColors, DeviceControl, DeviceIntensitySteps, DINVideo1, DINVideo2, DisplaySizeMeasurement, DitherTest, EquivalentBrightnessContext, ErrorControl, ExternalSignalOn, FillingIn, FixationMark, FontDisplay, FrameAnimation, FramedRod, FramedSquares, GameBoard, GeometricPath, GlowingAxes, GrayLevels, HeadMotionInducedMotion, HermannGrid, HFHorLines, HFVertLines, HIStairs, HomageToTheSquare, HorizontalVerticalIllusion, HTTPRequest, HVInterlace, HVInterlace2, Hypersaturation, IlluminationDeviceControl, Induction, InductionByAfterImage, InductionMatching, InitCounter, Kanizsa, LFHorLines, LFVertLines, LinAchStairs, LinChStairs, LIStairs, LookingGlass, MachBands, MaskedArrow, MaxwellDisk, MediaPlayer, MondrianMixturePattern, MoveProblem, MuellerLyer, NeonColors, Nothing, OpponentColorsSuccessiveContrast, OrderedFieldOfColors, Picture, PointLightsMixed, PolyArea, ProtanopicConfusionColors, PsychometricFunctionSimulator, PXLabLogo, RandomContextColorMatching, RandomDotField, RandomGenerator, RandomTilesColorVisionTest, RandomTilesMask, RectTest, RedSquares, ResponseControlStart, ResponseControlStop, ResponseRobot, ScreenCapture, SearchPattern, SelfAssessmentManikin, SessionStateControl, SetParameter, SimpleCenterSurround, SimultanousBrightnessContrast, SimultanousColorContrast, SinusoidalGrating, Smiley, SoundDisplay, SpatialAttentionFrames, SpatialColorMixing, SpatialColorRes, SpatialMatching, SpectralColorDisplay, StartClock, StripeInduction, SystemProcess, TimingGroupsTest, Todorovic2, TodorovicFigure, Trigger, TritanopicConfusionColors, TwoStrings, VisionDemonstrationsLogo, VisualGammaFields, VisualGammaTarget, WertheimerBenary, WhitePointControl, WhitesIllusion

public abstract class Display
extends DisplaySupport
implements ExParTypeCodes, Topics, TimerBitCodes

A stimulus in an experiment is composed of a sequence of Display objects. Every Display object contains a list of DisplayElement objects which constitute the basic geometric objects, like bars or disks of a complex stimulus. The Display also has a list of experimental parameters which are associated with it, like sizes or color values. The class Display is an abstract class and does not have a constructor. Instances are created by calling the constructor of a concrete subclass. The constructor of these subclasses, however, do nothing but create the title and the parameters of the Display. In order to create a concrete Display object the method createInstance() is called which creates the DisplayElement list of the Display and sets its color and timing properties. The display needs to know the target component where it will be shown in order to adapt its size parameters to the target panel size.

Here is a overview of how a Display object comes into existence. This involves three steps:

  1. Instantiation by calling the Display object's constructor or by calling the static method load() of class DisplaySupport. This creates the Display's name and its experimental parameters which are public fields of a display.
  2. A call of the method createInstance() sends a create() message to the display object and generates its list of display elements. These do have geometry types, colors, and timing properties but do not yet have their geometric, color, and timing propertiese computed. createInstance() also creates the experimental parameter descriptors which classify the parameters of a Display into geometry, color, timing and other types. These classifications are used by Display object editors. Experiments should call the createInstance() method only once for each Display object.
  3. A call to the recompute(DisplayPanel) method finally computes the color, geometry, and timing properties of the display for the given display panel according to the current values of the Display object's experimental parameters. This finally makes it possible to show the display. The various recompute() methods may be called repeatedly. They must be called whenever a Display object should be reinitialized to its current experimental parameter values. Display objects have three major groups of properties: timing, color, and geometry. Each of these has its own method for recomputing since they will usually be modified independently.

    The recomputeGeometry(int width, int height) method sets the width and height parameters, sets the Display objects background field and then delegates further computations to the recomputeGeometry() method. The recomputeGeometry() method delegates its work to the method computeGeometry() which must be defined in any subclass of the class Display since it is defined abstract in class Display.

    The method recomputeColors() delegates its work to the method computeColors() which also must be defined in a subclass of the class Display if the subclass object has dependent colors. These are colors which are computed from other colors. An example for this are color mixtures which depend on the mixture components.

    The method recomputeTiming() computes the Display object's timing properties from the display element groups and the timing parameters defined in the create() method.

The Display can be shown in several different modes:

Version:
0.6.4
Author:
H. Irtel

Field Summary
protected  long activeTimingGroup
          Contains the currently active timing group pattern.
protected  int activeTimingGroupIndex
           
protected  double[] axisDeltas
           
protected  int backgroundFieldIndex
          Index of this display's background field in the list of display elements.
protected  java.awt.Rectangle boundingBox
          This is the bounding box of this Display object AFTER it has been drawn!
protected  int changedPolledButtonIndex
           
protected  java.awt.Component displayComponent
          This is the Component we are drawing on.
protected  DisplayDevice displayDevice
          The DisplayDevice object which is used to show this Display object.
protected  java.util.ArrayList displayElementList
          The display element list is the list of display elements contained in this display.
 ExPar Duration
          This is the intended duration of this display.
 ExPar Execute
          Controls whether this display is executed within a display list or not.
protected  int frameIncrement
          Increment for counting animation frames.
protected  int framesPerCycle
          Number of animation frames per single display cycle.
protected  java.awt.Graphics graphics
          This is the graphics context we will use to paint the display list of this display.
protected  java.awt.Graphics2D graphics2D
           
protected  int height
          This is the height of the component where this display will be shown.
 ExPar JustInTime
          Controls the point in time when this display object's properties are computed.
protected  Display next
          A link to the next Display in a list which should be drawn simultanously because it is a JOIN overlay of this Display object.
 ExPar Overlay
          Controls whether this display object's background is drawn or not.
protected  int pointerActivationButton
           
protected  int pointerActivationX
           
protected  int pointerActivationY
           
protected  boolean pointerActive
           
protected  int pointerCurrentButton
           
protected  int pointerCurrentX
           
protected  int pointerCurrentY
           
protected  long pointerEventTime
           
protected  int pointerReleaseButton
           
protected  int pointerReleaseX
           
protected  int pointerReleaseY
           
protected  ResponseEvent pointerResponseEvent
           
protected  boolean[] polledButtonStates
           
protected  PresentationManager presentationManager
          The PresentationManager object which controls the presentation of this Display.
 ExPar ResponseChar
          Character code for the response key which stopped the display time interval on keyboard responses.
 ExPar ResponseCode
          This is a code generated by the event which stopped the display time interval.
 ExPar ResponsePosition
          Contains the position of the mouse pointer when a mouse response has been detected.
 ExPar ResponseSet
          The initial value of this parameter can be an array of key codes.
 ExPar ResponseTime
          This parameter stores the actual display duration.
 ExPar Screen
          Screen selection code for the screen where this display object should be shown in multiple screen systems.
protected  java.awt.Rectangle screenButton
          A rectangle on the screen which can be used as a stop button for mouse tracking responses.
protected  boolean startAdjustable
          This is true if this Display is the first of a possible sequence of Display objects which are overlays and which contain an adjustable Display object.
protected static int STEREO_LEFT
           
protected static int STEREO_NONE
           
protected static int STEREO_RIGHT
           
 ExPar TimeControl
          Contains the actual time when this display's timing groups have been shown.
 ExPar TimeError
          Contains the timing error for every timing group of this Display object which has a CLOCK_TIMER.
 ExPar Timer
          This defines the timer which will be used to control the duration of this display.
protected  boolean transparentOverlayFollows
          True if this Display object is followed by a TRANSPARENT overlay in a Display list.
protected  int width
          This is the width of the component where this display will be shown.
 
Fields inherited from class de.pxlab.pxl.DisplaySupport
exParFields, group, instanceName, node, timingGroupLimit
 
Fields inherited from interface de.pxlab.pxl.ExParTypeCodes
ANGLE, COLOR, COLOR_EDITOR, DEPCOLOR, DOUBLE, DURATION, editor, EXPARNAME, EXPFACTOR, FLAG, FONTNAME, GEOMETRY_EDITOR, HORSCREENPOS, HORSCREENSIZE, INT_8_BIT, INTEGER, KEYCODE, PROPORT, PROPORTION, RTDATA, SCREENPOS, SCREENSIZE, SIGNED_PROPORTION, SMALL_DOUBLE, SMALL_INT, SMALL_SCREENSIZE, SMALL_VISUAL_ANGLE, SPECTRUM, STRING, TIMING_EDITOR, UNKNOWN, VERSCREENPOS, VERSCREENSIZE, VISUAL_ANGLE
 
Fields inherited from interface de.pxlab.pxl.Topics
ADAPTATION_DSP, APPARENT_MOTION_DSP, ASSIMILATION_DSP, ATTEND_DSP, AUDIO_DSP, CLEAR_DSP, COLOR_CONTRAST_DSP, COLOR_DISCRIMINATION_DSP, COLOR_SPACES_DSP, COMPLEX_COLOR_MATCHING_DSP, COMPLEX_GEOMETRY_DSP, CONTROL_DSP, DATA, DEMO, DISPLAY_TEST_DSP, EXP, EXTERNAL_DSP, FEEDBACK_DSP, GRATING_DSP, GUI_COMPONENT_DSP, INTRO_DSP, LATERAL_INHIBITION_DSP, LETTER_MATRIX_DSP, MEDIA_DSP, PATTERN_IMAGE_DSP, PHOTOMETRY_DSP, PICTURE_DSP, PROBLEM_SOLVING_DSP, PROC_MESSAGE_DSP, QUESTIONNAIRE_DSP, RANDOM_DOT_DSP, SEARCH_DSP, SERIAL_TEXT_DSP, SIMPLE_COLOR_MATCHING_DSP, SIMPLE_GEOMETRY_DSP, SPECTRAL_COLOR_DSP, TEXT_PAR_DSP, topicDescription, VISUAL_GAMMA_DSP
 
Fields inherited from interface de.pxlab.pxl.TimerBitCodes
AXIS_TRACKING_BIT, CLOCK_TIMER_BIT, DOWN_TIMER_BIT, END_OF_MEDIA_TIMER_BIT, FIXED_DELAY_BIT, KEY_TIMER_BIT, MOUSE_BUTTON_TIMER_BIT, MOUSE_TRACKING_BIT, NO_TIMER_BIT, SERIAL_LINE_TIMER_BIT, START_RESPONSE_TIMER_BIT, STOP_KEY_TIMER_BIT, STOP_RESPONSE_TIMER_BIT, STORE_TIMER_BIT, SYNC_TO_MEDIA_TIMER_BIT, UP_TIMER_BIT, VIDEO_SYNCHRONIZATION_BIT, VOICE_KEY_TIMER_BIT, WATCH_SPURIOUS_RESPONSES_BIT, WHEEL_TRACKING_BIT, XBUTTON_TIMER_BIT
 
Constructor Summary
Display()
           
 
Method Summary
protected  boolean axisDeltasChanged()
          This should be overridden by subclasses if they want to intercept polled device axis responses.
protected  boolean buttonsPolled()
          This should be overridden by subclasses if they want to intercept polled button responses.
 boolean canShowSpectralDistributions()
          Check whether this display can tell us its illuminant name and the name of the reflectance functions of its display elements.
 boolean canStep()
          Allows the display manager to figure out whether this instance of a display has timing groups.
protected  void check4MediaTimer()
          Make sure that this object uses a MEDIA_TIMER.
protected  void clearBoundingBox()
          Clear this Display object's bounding box.
 void clearCurrentTimingGroup()
          Removes the objects which belong to the current timing group of the currently active activeDisplay.
 void clearNextTimingGroupImagePreload()
          Tell the timing group whose image had been preloaded by this Display object that the background buffer had become invalid and thus it should behave as if it never had been preloaded.
 void clearTimingGroup()
          Reset the active timing group pattern.
 void computeAnimationFrame(int frame)
          This method is called by RealTimeDisplayPanel objects from within the AnimationPlayer's run() method whenever a new animation frame should be computed.
protected  void computeBackgroundField()
           
protected  void computeColors()
          A display's computeColors() method is called at display creation and whenever a color has been changed.
protected abstract  void computeGeometry()
          A Display's computeGeometry() method is called whenever the size of the receiving display panel is initialized or has been changed, or a geometry parameter of the display has been adjusted.
protected  void computeStereographicGeometry(int s)
          Compute the left/right eye stereographic modifications of the geometry of this display.
protected  void computeTiming()
          A display's computeTiming() method is called at display creation and whenever a timing element has been changed.
protected abstract  int create()
          Create the display element list and the timing element list for this display.
 void createInstance()
          Create the display's list of display elements and timing groups.
 int defaultTiming()
           
 int defaultTiming(int refIndex)
           
protected  void destroy()
          Give the display instance a chance to do some cleaning up of resources.
 void destroyInstance()
          Destroy this instance of the display because the user has selected another one to view.
protected  int displayElementCount()
          Return the number of display elements in this display.
 boolean displayListControlState(ResponseController rc)
          Compute the display list control state and send it to the display timer if necessary.
protected  void disposeGraphicsContext()
           
protected  int enterBackgroundField()
          Enter the default background field into the display element list.
protected  int enterDisplayElement(DisplayElement p)
          Enter the given DisplayElement object into the display's list of DisplayElements.
protected  int enterDisplayElement(DisplayElement p, long s)
          Enter the given DisplayElement object into the display's list of DisplayElements and also define this element's stepping pattern.
 int enterTiming(ExPar timing, ExPar duration, ExPar responseSet, int refIndex, ExPar rtime, ExPar rcode)
           
 int enterTiming(ExPar timing, ExPar duration, ExPar responseSet, int refIndex, ExPar rtime, ExPar rcode, ExPar rpos)
           
 int enterTiming(ExPar timing, ExPar duration, int refIndex)
          Enter the given experimental parameter name into the timing list for this display.
 int enterTiming(ExPar timing, ExPar duration, int refIndex, ExPar rtime, ExPar rcode)
           
 int enterTiming(ExPar timing, ExPar duration, int refIndex, ExPar rtime, ExPar rcode, ExPar rpos)
           
protected  void finished()
          Called when the complete display presentation has been finished including adjustment methods.
 TimingElement getActiveTimingElement()
          Get the timing list entry for the given step.
 boolean getAdjustable()
          Returns true if this display contains an adjustable element while a trial is run.
 boolean getAllowTimerStop(int rc)
          Get the flag which allows a timer to stop this display.
 java.awt.Rectangle getBoundingBox()
          Return this Display object's bounding box which is only valid after the object has been shown on the screen.
 boolean getCanPreload()
          Get this Display object's preload flag.
protected  ExPar getColorParOfDisplayElement(int i)
          Return the color index of the i-th DisplayElement of this display.
 DisplayElement getDisplayElement(int i)
          Get the DisplayElement at the given index in the displayElementList.
 DisplayElement getDisplayElementAt(int x, int y)
          Find the display element whose bounding rectangle contains the specified point in the display panel.
 java.util.ArrayList getDisplayElementList()
          Returns the display's list of display elements.
 boolean getDisplayListControl()
          Get the display list control indicator flag.
 TimingElement getDisplayTiming()
          Get a valid timing element which is made up from the timing parameters Timer, Duration, ResponseSet, ResponseTime, ResponseCode of this class.
 ExPar getDynExPar()
          Get the adaptive/adjustable experimental parameter.
 int getFrameIncrement()
          Get the number of frames which should be computed and displayed for a single motion cycle.
 int getFramesPerCycle()
          Return the number of animation frames per display cycle.
protected  boolean getFullRecompute()
           
 int getIndexOf(DisplayElement d)
          Get the index of the given DisplayElement in the displayElementList.
 DisplayElement getInitialDisplayElement()
           
 long getLastTimingGroup()
          Return the timing group pattern of the last timing group of this display.
 int getLastTimingGroupIndex()
          Return the index of the last timing group of this display.
protected  java.awt.Rectangle getScreenButton()
           
 TimingElement getTiming(int i)
          Get the timing list entry for the given step.
 TimingElement getTimingElement(int i)
          Get the TimingElement at the given index in the timingList.
 int getTimingGroupCount()
          Return the number of timing groups of this display.
protected  long getTimingGroupPattern(int i)
          Return the timing group pattern of the i-th display element of this display.
 boolean getTransparentOverlayFollows()
           
 boolean getVisible()
          Get the visible flag.
 boolean hasSpectralDistributions()
          Check whether this Display object has a spectral color distribution to show in a spectral color distribution panel.
 boolean isAnimated()
          Allows the display panel to figure out whether this instance of a display has an animated version.
 boolean isClearListOverlay()
           
 boolean isGraphic()
          Return true if this display object requires graphic screen resources for being shown.
 boolean isJoinOverlay()
           
 boolean isListOverlay()
           
 boolean isNoOverlay()
           
 boolean isStereo()
          Allows the display panel to figure out whether this instance of a display has two stereographic versions.
 boolean isTransparentOverlay()
           
protected  boolean keyResponse(java.awt.event.KeyEvent keyEvent)
          This method is here to be overridden by display objects which want to respond to single key strokes which do NOT stop the display timer.
protected  int nextDisplayElementIndex()
          Return the index of the next display element entered into the display list.
protected  int nextTimingElementIndex()
          Return the index of the next timing element entered into the timing list.
 boolean nextTimingGroup()
          Move the timing group display state to the next group of display elements.
protected  boolean pointerActivated()
          This should be overridden by subclasses if they want to intercept pointer activation responses.
protected  boolean pointerDragged()
          This should be overridden by subclasses if they want to intercept pointer dragging responses.
protected  boolean pointerMoved()
          This should be overridden by subclasses if they want to intercept pointer motion responses.
protected  boolean pointerReleased()
          This should be overridden by subclasses if they want to intercept pointer release responses.
 void preloadTimingGroupImage(TimingElement te)
          Load the given timing group's image into the display device's back buffer.
 void printTiming()
          Show this display's current timing parameters.
 void recompute(java.awt.Component displayComponent)
          This computes all display properties which have associated experimental parameters from the current values in the experimental parameter table.
 void recompute(PresentationManager presentationManager)
          Compute all display properties for the DisplayDevice of the given PresentationManager.
 void recomputeColors()
          Recompute the dependent colors because one of the independent colors has been changed.
 void recomputeGeometry()
          Recompute this display's display elements from the current experimental parameter values.
 void recomputeGeometry(int w, int h)
          Recompute the current display's display elements from their current experimental parameter values for a display panel of the given size.
 void recomputeTiming()
          Recompute the timing parameters from the experimental parameter values.
protected  void removeDisplayElements(int first)
          Remove all display elements starting from the given index first from the display's list of DisplayElements.
protected  void removeDisplayElements(int first, int last)
          Remove all display with index values from first to last (inclusive) from the display's list of DisplayElements.
protected  void removeTimingElements(int first)
          Remove all timing elements with index values starting from first from the display's list of TimingElements.
protected  void removeTimingElements(int first, int last)
          Remove all timing elements with index values from first to last (inclusive) from the display's list of TimingElements.
protected  void screenButtonPressed()
          Signal the Display object that the mouse pointer has been pressed inside the screen button area.
protected  void screenButtonReleased()
          Signal the Display object that the mouse pointer has been released inside the screen button area.
 void setAdjustable(boolean a)
          Set the adjustable flag to indicate whether this display contains an adjustable element while a trial is run.
 boolean setAxisDeltas(double[] d)
           
 void setBackgroundColorPar(ExPar p)
          Display objects which want to use their private background color parameter should use this method to set the background display element's color parameter.
 void setCanPreload(boolean s)
          Set this Display object's preload flag.
protected  void setDisplayListControl()
          Make this a display list control display.
 void setDynExPar(ExPar x)
          Set the adaptive/adjustable experimental parameter.
 void setFrameIncrement(int f)
          Set the number of frames which should be computed and displayed for a single motion cycle.
 void setFramesPerCycle(int fpc)
          Set the number of frames which should be computed and displayed for a single animation cycle.
protected  void setFullRecompute(boolean s)
           
protected  void setGraphicsContext(java.awt.Graphics g)
          Set the display context for showing display elements.
 boolean setKeyResponse(java.awt.event.KeyEvent keyEvent)
          Signals the display object that a response key has been pressed which was not identical to the StopKey.
 void setListOverlay(Display ovrlay)
          Set a permanent transparent overlay display for this Display object.
 boolean setPointerActivationState(ResponseEvent e, long t)
          This defines the state of the pointer when it was last activated.
 boolean setPointerDraggedState(ResponseEvent e)
          This defines the current state of the pointer device if it has bee changed by dragging the pointer with button down.
 boolean setPointerMovedState(ResponseEvent e)
          This defines the current state of the pointer device if it has bee changed by moving the pointer with button up.
 boolean setPointerReleaseState(ResponseEvent e, long t)
           
 boolean setPolledButtonStates(int cbi, boolean[] b)
           
protected  void setScreenButton(java.awt.Rectangle b)
          Defines a rectangle on the screen which can be used as a stop button for mouse tracking responses.
 void setTimeControl()
          Set this display's time control parameter from the timing element data.
 void setTimingGroup(int i)
          Set the currently active timing group pattern to the i-th timing group of this Display.
 void setTransparentOverlayFollows(boolean s)
           
 void setVisible(boolean v)
          Set the flag to indicate that this is a visible display.
 void show()
          Draws all objects in the list of DisplayElements but the background.
 void show(java.awt.Graphics g)
          Draws the background if it has been defined and then draws all objects in the list of DisplayElements.
 void showAnimationFrame(java.awt.Graphics g, int frame)
          This method is called by the DisplayPanel class's AnimationPlayer object to show the given animation frame of this display in the given graphics context.
 void showAnimationFrame(int n)
          Animated displays have to override this in order to run frame depenendent animations.
protected  void showBackgroundElement()
          Show only the background element assuming that a proper graphics context is set.
 long showCurrentTimingGroup()
          Show the current timing group of display elements.
 void showGroup()
          Shows the currently active timing group as it is defined by the current value of activeTimingGroup.
 void showGroup(java.awt.Graphics g)
          First shows the background element if necessary and then shows all objects belonging to the current timing group.
protected  void showGroupStereo()
           
protected  void showStereo()
           
protected  void timingGroupFinished(int group)
          This method is called when the display of the currently active timing group has been finished.
 java.lang.String toString()
           
protected  void updateBoundingBox(java.awt.Rectangle b)
          Add the given rectangle to this Display's current bounding box.
 
Methods inherited from class de.pxlab.pxl.DisplaySupport
centeredRect, centeredSquare, createExParFields, firstSquareOfTwo, getClassName, getColorPars, getExDesignNode, getExParFields, getExParName, getGeometryPars, getGroup, getInstanceName, getTimingPars, getTitle, getTopic, getXPars, hugeSquare, hugeSquareSize, inner3rdRect, innerRect, largeSquare, largeSquareSize, load, mediumSquare, mediumSquareSize, rectPattern, rectPattern, rectPattern, relSquareSize, reportPars, secondSquareOfTwo, setExDesignNode, setExParFields, setExParFields, setInstanceName, setTitleAndTopic, smallSquare, smallSquareSize, squareSizeOfTwo, tinySquare, tinySquareSize
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

STEREO_NONE

protected static final int STEREO_NONE
See Also:
Constant Field Values

STEREO_LEFT

protected static final int STEREO_LEFT
See Also:
Constant Field Values

STEREO_RIGHT

protected static final int STEREO_RIGHT
See Also:
Constant Field Values

Timer

public ExPar Timer
This defines the timer which will be used to control the duration of this display. Note that the duration time interval begins when a display object is drawn and ends only when the next display object is drawn. If this paramer is NO_TIMER then this display object is drawn and then the next display object of the display list followes immediately.


TimeControl

public ExPar TimeControl
Contains the actual time when this display's timing groups have been shown. Is an array if the display object contains more than a single timing group. This parameter is only set after the display list which contains this display has been shown completely.


Duration

public ExPar Duration
This is the intended duration of this display.


TimeError

public ExPar TimeError
Contains the timing error for every timing group of this Display object which has a CLOCK_TIMER. Is an array if the display object contains more than a single timing group. This parameter is only set after the display list which contains this display has been shown completely.


ResponseTime

public ExPar ResponseTime
This parameter stores the actual display duration. For response driven timers this will also be the response time. For clock driven timers this parameter presents one method to control the timing precision since it contains the actually measured time interval duration.


ResponseCode

public ExPar ResponseCode
This is a code generated by the event which stopped the display time interval. For response driven timers this will be a code generated by the response device. For mouse buttons the code corresponds to the button numbers for keyboard keys the code corresponds to the unmodified key code. If the parameter ResponseSet is defined then the ResponseCode is translated into the index of the respective device code within the ResponseSet array.


ResponseChar

public ExPar ResponseChar
Character code for the response key which stopped the display time interval on keyboard responses. This code will be identical to the ResponseCode value in most cases. It will be different from the ResponseCode value if (a) the respective response key does not have a code but does have an associated character (this is the case for umlaut keys) or (b) a modifier like the Alt or Shift key is activated. Note that there also exist keys which do not have character codes like the Alt or Shift key. These keys have the character code java.awt.event.KeyEvent.CHAR_UNDEFIND.

See Also:
KeyEvent

ResponsePosition

public ExPar ResponsePosition
Contains the position of the mouse pointer when a mouse response has been detected. It contains the key location code in case of keyboard responses. This may be used to distinguish between keys which appear more than once on a keyboard like the left and right shift keys or the keys in the separate numeric keypad. See class java.awt.event.KeyEvent for the KEY_LOCATION codes.

See Also:
KeyEvent

ResponseSet

public ExPar ResponseSet
The initial value of this parameter can be an array of key codes. In this case only response codes will be accepted which are contained in this array. The default value should be undefined otherwise all displays must use response code control since the ResponseEventGroup.getCode() method uses the undefined property to switch off code checking.

Note that setting the parameter ResponseSet not only restricts the set of possible response keys but also enables a translation mechanism. This translates the response key codes to response code values which correspond to the position within the array ResponseSet. This means that if the response set is defined to be [37, 39] and the actual response key has the code 39 then the parameter ResponseCode is set to 1 which is the index of the code 39 in the array ResponseSet. The translation mechanism is not used if ResponseSet is not set.


Screen

public ExPar Screen
Screen selection code for the screen where this display object should be shown in multiple screen systems.


Overlay

public ExPar Overlay
Controls whether this display object's background is drawn or not. If the flag is true then no background is shown under real time conditions. Otherwise the background is drawn whenever the display object is drawn. This does not affect the display drawing methods in editing and non real time modes.


JustInTime

public ExPar JustInTime
Controls the point in time when this display object's properties are computed. If true then this is done immediately before the display object is shown. If this is false then most properties are computed before the display list is started. Use this flag only if necessary, since it may reduce timing precision. Setting this flag is necessary whenever a display parameter value depends on the current value of a parameter of a display contained in the same display list.


Execute

public ExPar Execute
Controls whether this display is executed within a display list or not. Set this flag to 0 to disable execution.


presentationManager

protected PresentationManager presentationManager
The PresentationManager object which controls the presentation of this Display. It is needed since some special Display objects need to access it. Examples are the DeviceControl class which opens special devices or some media Display objects like MediaPlayer, SoundFile, SyntheticSound, or VoiceKey which need to access the ResponseManager.


displayDevice

protected DisplayDevice displayDevice
The DisplayDevice object which is used to show this Display object. It is needed by Display objects like MediaPlayer or ScreenCapture to access some special properties if the display device.


displayComponent

protected java.awt.Component displayComponent
This is the Component we are drawing on. Note that this is only rarely used. An example is class TextImage which needs a memory drawing buffer for this Component.


width

protected int width
This is the width of the component where this display will be shown. This is updated by calls to recomputeGeometry(int, int).


height

protected int height
This is the height of the component where this display will be shown. This is updated by calls to recomputeGeometry(int, int).


backgroundFieldIndex

protected int backgroundFieldIndex
Index of this display's background field in the list of display elements.


graphics

protected java.awt.Graphics graphics
This is the graphics context we will use to paint the display list of this display. This reference is updated by the methods setGraphicsContext(), show(Graphics), showGroup(Graphics), and showAnimation(Graphics, int).


graphics2D

protected java.awt.Graphics2D graphics2D

displayElementList

protected java.util.ArrayList displayElementList
The display element list is the list of display elements contained in this display. It is protected since subclasses which have their own show() method want to access it.


boundingBox

protected java.awt.Rectangle boundingBox
This is the bounding box of this Display object AFTER it has been drawn!


screenButton

protected java.awt.Rectangle screenButton
A rectangle on the screen which can be used as a stop button for mouse tracking responses.


startAdjustable

protected boolean startAdjustable
This is true if this Display is the first of a possible sequence of Display objects which are overlays and which contain an adjustable Display object. This is necessary such that Display objects which are overlays may be adjustable.


transparentOverlayFollows

protected boolean transparentOverlayFollows
True if this Display object is followed by a TRANSPARENT overlay in a Display list.


next

protected Display next
A link to the next Display in a list which should be drawn simultanously because it is a JOIN overlay of this Display object. This link is set/used only during Display presentation.


activeTimingGroup

protected long activeTimingGroup
Contains the currently active timing group pattern. Timing group patterns are binary bit patterns with a single bit set. The bit position indicates the sequential position of the timing group in the series of timing groups of a Display object. Display objects without timing groups always have a 0 timing group pattern.


activeTimingGroupIndex

protected int activeTimingGroupIndex

framesPerCycle

protected int framesPerCycle
Number of animation frames per single display cycle.


frameIncrement

protected int frameIncrement
Increment for counting animation frames.


pointerActivationButton

protected int pointerActivationButton

pointerActivationX

protected int pointerActivationX

pointerActivationY

protected int pointerActivationY

pointerReleaseButton

protected int pointerReleaseButton

pointerReleaseX

protected int pointerReleaseX

pointerReleaseY

protected int pointerReleaseY

pointerCurrentButton

protected int pointerCurrentButton

pointerCurrentX

protected int pointerCurrentX

pointerCurrentY

protected int pointerCurrentY

pointerResponseEvent

protected ResponseEvent pointerResponseEvent

pointerActive

protected boolean pointerActive

pointerEventTime

protected long pointerEventTime

axisDeltas

protected double[] axisDeltas

polledButtonStates

protected boolean[] polledButtonStates

changedPolledButtonIndex

protected int changedPolledButtonIndex
Constructor Detail

Display

public Display()
Method Detail

setScreenButton

protected void setScreenButton(java.awt.Rectangle b)
Defines a rectangle on the screen which can be used as a stop button for mouse tracking responses.


getScreenButton

protected java.awt.Rectangle getScreenButton()

setAdjustable

public void setAdjustable(boolean a)
Set the adjustable flag to indicate whether this display contains an adjustable element while a trial is run.


getAdjustable

public boolean getAdjustable()
Returns true if this display contains an adjustable element while a trial is run.


setDynExPar

public void setDynExPar(ExPar x)
Set the adaptive/adjustable experimental parameter. This parameter is marked by the adaptive/adjustable prefix in the parameter file and is set at runtime.

Parameters:
x - the experimental parameter which is to be set as the adaptive/adjustable parameter of this display.

getDynExPar

public ExPar getDynExPar()
Get the adaptive/adjustable experimental parameter.

Returns:
the experimental parameter which is to be used as the adaptive/adjustable parameter of this display.

setVisible

public void setVisible(boolean v)
Set the flag to indicate that this is a visible display. Invisible displays are recomputed while running a display list but they are not shown! This is used by Feedback or ResponseControl displays which can insert processing features into a display list.

Parameters:
v - if true then this display will be recomputed and shown, if false then the display will be recomputed but will not be shown.

getVisible

public boolean getVisible()
Get the visible flag.

Returns:
true if this display should be recomputed and shown and false if the display should only be recomputed but not shown.

setDisplayListControl

protected void setDisplayListControl()
Make this a display list control display. Display list control display objects have a method named displayListControlState() which is called immediately before the display is shown at runtime. If this method returns false then display list processing is stopped after this display has been shown. Showing the display may be prevented by calling setVisible(false) from within the displayListControlState() method. This makes it possible to check for certain events which should stop trial presentation. An example is a response error during an attention period.


getDisplayListControl

public boolean getDisplayListControl()
Get the display list control indicator flag.


setListOverlay

public void setListOverlay(Display ovrlay)
Set a permanent transparent overlay display for this Display object.


isNoOverlay

public boolean isNoOverlay()

isJoinOverlay

public boolean isJoinOverlay()

isListOverlay

public boolean isListOverlay()

isClearListOverlay

public boolean isClearListOverlay()

isTransparentOverlay

public boolean isTransparentOverlay()

setTransparentOverlayFollows

public void setTransparentOverlayFollows(boolean s)

getTransparentOverlayFollows

public boolean getTransparentOverlayFollows()

isGraphic

public boolean isGraphic()
Return true if this display object requires graphic screen resources for being shown. This is not the case for acoustic and other non-graphic Display objects.


setCanPreload

public void setCanPreload(boolean s)
Set this Display object's preload flag.

Parameters:
s - if true then this Display object can have an image which is preloaded at runtime. If false then this Display must be computed at runtime immediately before it is shown.

getCanPreload

public boolean getCanPreload()
Get this Display object's preload flag.

Returns:
true if this Display object can have an image which is preloaded at runtime and false if this Display must be computed at runtime immediately before it is shown.

setFullRecompute

protected void setFullRecompute(boolean s)

getFullRecompute

protected boolean getFullRecompute()

getAllowTimerStop

public boolean getAllowTimerStop(int rc)
Get the flag which allows a timer to stop this display. Display objects may prevent timers to stop them if stopping requires a certain display state. An example being display objects which require activation of one or more control elements before they may be stopped.

Returns:
true if it currently is possible to stop this display.

createInstance

public void createInstance()
Create the display's list of display elements and timing groups. The createInstance() method is called only once for each instance of a display and it is called before the display is attached to any display panel. It calls the subclass's create() method for creating the list of display element objects and associating experimental parameters with colors, timing and geometric properties of the display. This method also inserts a background field as the first display element of each display element list. No experimental parameter values are actually used during creation. Only list entries are prepared and parameter names are associated.

Specified by:
createInstance in class DisplaySupport

create

protected abstract int create()
Create the display element list and the timing element list for this display. This method is called only once per instance. Its task is to create the list of display and timing elements. Colors and timing properties are associated with their respective experimental parameter names here but are not yet initialized from the experimental parameter table. This is done later.


getInitialDisplayElement

public DisplayElement getInitialDisplayElement()

recompute

public void recompute(PresentationManager presentationManager)
Compute all display properties for the DisplayDevice of the given PresentationManager. This method is called by the PresentationManager's showDisplayList() method and from class EditablePresentationPanel after a new Display object has been set or after the panel has been resized.

Parameters:
presentationManager - the PresentationManager which runs this Display object. It is needed here in order to get the drawing surface of its DisplayDevice and for some Display objects which need to access the PresentationManager directly like the DeviceControl class.

recompute

public void recompute(java.awt.Component displayComponent)
This computes all display properties which have associated experimental parameters from the current values in the experimental parameter table. This method is used to (re)compute a single instance of a display such that it may be used with different sets of parameter values. This method is called from the DisplaySelectionDialog class showSelectedDisplay() method.

Parameters:
displayComponent - is the Component we will be drawing on. It is needed since some Display objects need to adjust their size according to the Component size.

recomputeGeometry

public void recomputeGeometry(int w,
                              int h)
Recompute the current display's display elements from their current experimental parameter values for a display panel of the given size. This method is called whenever a display object is created first and whenever the size of the display panel may have changed.


recomputeGeometry

public void recomputeGeometry()
Recompute this display's display elements from the current experimental parameter values. This method may be called repeatedly during adjustable displays. It assumes that the display panel has not changed!


computeGeometry

protected abstract void computeGeometry()
A Display's computeGeometry() method is called whenever the size of the receiving display panel is initialized or has been changed, or a geometry parameter of the display has been adjusted. This method does not recompute the background.


computeBackgroundField

protected void computeBackgroundField()

recomputeColors

public void recomputeColors()
Recompute the dependent colors because one of the independent colors has been changed.


computeColors

protected void computeColors()
A display's computeColors() method is called at display creation and whenever a color has been changed. Displays which have dependent colors must override this method in order to compute the dependent colors in the color table.


setBackgroundColorPar

public void setBackgroundColorPar(ExPar p)
Display objects which want to use their private background color parameter should use this method to set the background display element's color parameter.


getTimingElement

public TimingElement getTimingElement(int i)
Get the TimingElement at the given index in the timingList.


recomputeTiming

public void recomputeTiming()
Recompute the timing parameters from the experimental parameter values.


computeTiming

protected void computeTiming()
A display's computeTiming() method is called at display creation and whenever a timing element has been changed.


setTimeControl

public void setTimeControl()
Set this display's time control parameter from the timing element data.


printTiming

public void printTiming()
Show this display's current timing parameters.


check4MediaTimer

protected void check4MediaTimer()
Make sure that this object uses a MEDIA_TIMER.


displayListControlState

public boolean displayListControlState(ResponseController rc)
Compute the display list control state and send it to the display timer if necessary. This method must be overridden by control displays. This method is called before this display's list of display elements are shown. If the method returns true then this display's list of display elements is not shown by the display panel!

Parameters:
rc - the ResponseController object which controls response timing.
Returns:
true if the trial should procede as usual. Returns false if the trial should be stopped. Note that in the latter case this display will be shown if and only if its visible flag is set to true.

destroyInstance

public void destroyInstance()
Destroy this instance of the display because the user has selected another one to view. Clear the color table if requested and also give the display a chance to do some cleaning up.

Specified by:
destroyInstance in class DisplaySupport

destroy

protected void destroy()
Give the display instance a chance to do some cleaning up of resources. Subclasses may use this to do some special cleaning up.


clearBoundingBox

protected void clearBoundingBox()
Clear this Display object's bounding box. This method should be called by all methods which show the display object on the screen immediately before they start to show the object.


updateBoundingBox

protected void updateBoundingBox(java.awt.Rectangle b)
Add the given rectangle to this Display's current bounding box.

Parameters:
b - a rectangle which should be added to the current bounding box.

getBoundingBox

public java.awt.Rectangle getBoundingBox()
Return this Display object's bounding box which is only valid after the object has been shown on the screen. Note that each Display object contains a background element which, however, is NOT covered by its bounding box.

Returns:
a recangle which covers all DisplayElement objects of this Display. It is only valid after the Display object has been shown on screen.

setGraphicsContext

protected void setGraphicsContext(java.awt.Graphics g)
Set the display context for showing display elements. The graphics context in the argument must be valid.


disposeGraphicsContext

protected void disposeGraphicsContext()

show

public void show(java.awt.Graphics g)
Draws the background if it has been defined and then draws all objects in the list of DisplayElements. This method ignores the timing group patterns. Drawing is delegated to the DisplayElement objects.

Parameters:
g - a currently valid Graphics context for painting.

show

public void show()
Draws all objects in the list of DisplayElements but the background. Drawing is delegated to the DisplayElement objects.


showStereo

protected void showStereo()

getDisplayElementAt

public DisplayElement getDisplayElementAt(int x,
                                          int y)
Find the display element whose bounding rectangle contains the specified point in the display panel. Note that bounding rectangles are only defined after a display has been painted. This method tries to find the smallest display element which contains the given pixel position.

Parameters:
x - horizontal pixel position.
y - vertical pixel position.
Returns:
the DisplayElement object at the given pixel position.

canStep

public boolean canStep()
Allows the display manager to figure out whether this instance of a display has timing groups.


nextTimingGroup

public boolean nextTimingGroup()
Move the timing group display state to the next group of display elements. This method is called whenever the next timing group of a display should be displayed. The next group may be the first in a sequence of timing groups. In this case the group display state is set to the first group. In all other cases the timing group pattern is advanced to the next group. This method should only be called either for the first step in a timing cycle or as long as the previous call has returned true.

Returns:
true if the step we moved to actually exists as a display element timing group

setTimingGroup

public void setTimingGroup(int i)
Set the currently active timing group pattern to the i-th timing group of this Display.


clearTimingGroup

public void clearTimingGroup()
Reset the active timing group pattern. This is called whenever the display is changed or when a Display's presentation starts in order to make sure that this display is in a definite timing display state.


getLastTimingGroup

public long getLastTimingGroup()
Return the timing group pattern of the last timing group of this display.


getLastTimingGroupIndex

public int getLastTimingGroupIndex()
Return the index of the last timing group of this display.


getTimingGroupCount

public int getTimingGroupCount()
Return the number of timing groups of this display.


getTimingGroupPattern

protected long getTimingGroupPattern(int i)
Return the timing group pattern of the i-th display element of this display.


getActiveTimingElement

public TimingElement getActiveTimingElement()
Get the timing list entry for the given step.


showCurrentTimingGroup

public long showCurrentTimingGroup()
Show the current timing group of display elements. If the timing group has its image preloaded into the back buffer then the only thing done is to switch on the back buffer. If the timing group has a memory image then the memory image is shown. If none of this is the case then the display elements are painted into the back buffer and then the back buffer is switched on.

To be done: Implement TRANSPARENT overlays for JustInTime Display objects. This means that a JustInTime object has to store its image if it is followed by a TRANSPARENT Display. This display may then use the image to initialize its background before painting.

Returns:
the nanosecond time when the timing group has been shown.

clearNextTimingGroupImagePreload

public void clearNextTimingGroupImagePreload()
Tell the timing group whose image had been preloaded by this Display object that the background buffer had become invalid and thus it should behave as if it never had been preloaded. This is the case when a timing group is repainted outside of the PresentationManager in a timing group controlled by a STOP_KEY_TIMER.


preloadTimingGroupImage

public void preloadTimingGroupImage(TimingElement te)
Load the given timing group's image into the display device's back buffer.

Parameters:
te - the timing element whose image should be loaded. The timing element is marked as having its image preloaded.

clearCurrentTimingGroup

public void clearCurrentTimingGroup()
Removes the objects which belong to the current timing group of the currently active activeDisplay. This is currently not used since every timing group starts with a clear screen object.


showGroup

public void showGroup(java.awt.Graphics g)
First shows the background element if necessary and then shows all objects belonging to the current timing group. The background element is not shown of this Display object has its Overlay flag set.

Parameters:
g - the Graphics context for painting.

showGroup

public void showGroup()
Shows the currently active timing group as it is defined by the current value of activeTimingGroup. Subclasses which want to modify the timing group display method should override this method. This method assumes that the graphics context has already been set and the background has been drawn.


showGroupStereo

protected void showGroupStereo()

showBackgroundElement

protected void showBackgroundElement()
Show only the background element assuming that a proper graphics context is set. This method is needed for animations which have to show their background before starting since the animation itself does not show the background.


timingGroupFinished

protected void timingGroupFinished(int group)
This method is called when the display of the currently active timing group has been finished. It may be overridden by Display objects which need to do some clean up after a timing group has been finished.

Parameters:
group - the index of the timing group which has been run.

finished

protected void finished()
Called when the complete display presentation has been finished including adjustment methods. Currently only for adjustment displays: It is called when the stop key has been detected.


canShowSpectralDistributions

public boolean canShowSpectralDistributions()
Check whether this display can tell us its illuminant name and the name of the reflectance functions of its display elements.

Returns:
true if the display has an illuminant and has reflectance functions, false otherwise.

hasSpectralDistributions

public boolean hasSpectralDistributions()
Check whether this Display object has a spectral color distribution to show in a spectral color distribution panel.

Returns:
true if the display has a spectral color distribution to show such that the editor should open a spectral color distribution panel for it.

isStereo

public boolean isStereo()
Allows the display panel to figure out whether this instance of a display has two stereographic versions. Must be overridden by displays which are able to draw stereographic versions.


computeStereographicGeometry

protected void computeStereographicGeometry(int s)
Compute the left/right eye stereographic modifications of the geometry of this display. Note that this method is called after the computeGeometry() method has already been called for this display.

Should be overriden by display objects which can show stereographic versions.

Parameters:
s - indicates which stereographic channel to compute. O means that left and right eye get the same information while 1 creates the left and 2 creates the right eye view.

isAnimated

public boolean isAnimated()
Allows the display panel to figure out whether this instance of a display has an animated version. Must be overridden by displays which are animated.

Note that animated Display objects must not use the parameters Timer, Duration, ResponseSet, ResponseTime, ResponseCode for its internal timing groups since these are used to describe the timing properties of the whole Display object. The RealTimeDisplayPanel's AnimationPlayer retrieves these parameter values from the Display class directly.


computeAnimationFrame

public void computeAnimationFrame(int frame)
This method is called by RealTimeDisplayPanel objects from within the AnimationPlayer's run() method whenever a new animation frame should be computed. The Display object should respond by computing its geometry and color properties for the given frame. The AnimationPlayer then shows the Display object using the showGroup() method for drawing Display objects with timing groups being observed.


showAnimationFrame

public void showAnimationFrame(java.awt.Graphics g,
                               int frame)
This method is called by the DisplayPanel class's AnimationPlayer object to show the given animation frame of this display in the given graphics context.

Note that this method is obsolete and should no longer be used.


showAnimationFrame

public void showAnimationFrame(int n)
Animated displays have to override this in order to run frame depenendent animations.

Note that this method is obsolete and should no longer be used. It should be replaced by using computeAnimationFrame().


setFramesPerCycle

public void setFramesPerCycle(int fpc)
Set the number of frames which should be computed and displayed for a single animation cycle.


getFramesPerCycle

public int getFramesPerCycle()
Return the number of animation frames per display cycle.


setFrameIncrement

public void setFrameIncrement(int f)
Set the number of frames which should be computed and displayed for a single motion cycle.


getFrameIncrement

public int getFrameIncrement()
Get the number of frames which should be computed and displayed for a single motion cycle.


nextDisplayElementIndex

protected int nextDisplayElementIndex()
Return the index of the next display element entered into the display list.


displayElementCount

protected int displayElementCount()
Return the number of display elements in this display.


getDisplayElementList

public java.util.ArrayList getDisplayElementList()
Returns the display's list of display elements.


enterBackgroundField

protected int enterBackgroundField()
Enter the default background field into the display element list. Its color is defined by the global parameter ScreenBackgroundColor. The background field does not belong to any timing group.


enterDisplayElement

protected int enterDisplayElement(DisplayElement p)
Enter the given DisplayElement object into the display's list of DisplayElements. Returns the index of this object in the list.


enterDisplayElement

protected int enterDisplayElement(DisplayElement p,
                                  long s)
Enter the given DisplayElement object into the display's list of DisplayElements and also define this element's stepping pattern. Returns the index of this object in the list.


getDisplayElement

public DisplayElement getDisplayElement(int i)
Get the DisplayElement at the given index in the displayElementList.


getIndexOf

public int getIndexOf(DisplayElement d)
Get the index of the given DisplayElement in the displayElementList.


getColorParOfDisplayElement

protected ExPar getColorParOfDisplayElement(int i)
Return the color index of the i-th DisplayElement of this display.


removeDisplayElements

protected void removeDisplayElements(int first)
Remove all display elements starting from the given index first from the display's list of DisplayElements.

Parameters:
first - index of first element to remove.

removeDisplayElements

protected void removeDisplayElements(int first,
                                     int last)
Remove all display with index values from first to last (inclusive) from the display's list of DisplayElements.

Parameters:
first - index of first element to remove.
last - index of last element to remove.

enterTiming

public int enterTiming(ExPar timing,
                       ExPar duration,
                       int refIndex)
Enter the given experimental parameter name into the timing list for this display.

Every display element of a display list belongs at least to one timing group. A timing group is a group of display elements which always are shown simultanously. The stepping display method shows the timing groups in sequence. A timing controlled display method also shows the display list by its timing groups. Each timing group has associated timing parameters which controll when this group is switched on. The timing parameter of a display element group defines the onset time difference between this group and another group, usually the group immediately shown before.

Parameters:
timing - the experimental parameter which defines the given timing group's timing type.
duration - the duration of the given timing group's timing interval.
refIndex - the index in the timing list of that timing group to which the given timing parameter refers to as its starting time point for time measurement.
Returns:
the index in the timing list where the experimental parameter was entered.

enterTiming

public int enterTiming(ExPar timing,
                       ExPar duration,
                       int refIndex,
                       ExPar rtime,
                       ExPar rcode)

enterTiming

public int enterTiming(ExPar timing,
                       ExPar duration,
                       ExPar responseSet,
                       int refIndex,
                       ExPar rtime,
                       ExPar rcode)

enterTiming

public int enterTiming(ExPar timing,
                       ExPar duration,
                       int refIndex,
                       ExPar rtime,
                       ExPar rcode,
                       ExPar rpos)

enterTiming

public int enterTiming(ExPar timing,
                       ExPar duration,
                       ExPar responseSet,
                       int refIndex,
                       ExPar rtime,
                       ExPar rcode,
                       ExPar rpos)

defaultTiming

public int defaultTiming(int refIndex)

defaultTiming

public int defaultTiming()

nextTimingElementIndex

protected int nextTimingElementIndex()
Return the index of the next timing element entered into the timing list.


getTiming

public TimingElement getTiming(int i)
Get the timing list entry for the given step.


removeTimingElements

protected void removeTimingElements(int first)
Remove all timing elements with index values starting from first from the display's list of TimingElements.

Parameters:
first - index of first element to remove.

removeTimingElements

protected void removeTimingElements(int first,
                                    int last)
Remove all timing elements with index values from first to last (inclusive) from the display's list of TimingElements.

Parameters:
first - index of first element to remove.
last - index of last element to remove.

getDisplayTiming

public TimingElement getDisplayTiming()
Get a valid timing element which is made up from the timing parameters Timer, Duration, ResponseSet, ResponseTime, ResponseCode of this class. This method is used to define the timing of Display objects which are shown repeatedly like those which are shown by an animation player. In this case the timing groups define the timing within the display of a single cycle but this timing element defines the timing of the animation sequence.

Returns:
a TimingElement object which may be used to define the Display object's timing without using the Display's timing groups.

setPointerActivationState

public boolean setPointerActivationState(ResponseEvent e,
                                         long t)
This defines the state of the pointer when it was last activated. This corresponds to the position when the mouse button was last pressed.

Returns:
true if the Display object should be redrawn and false if not.

setPointerReleaseState

public boolean setPointerReleaseState(ResponseEvent e,
                                      long t)

setPointerDraggedState

public boolean setPointerDraggedState(ResponseEvent e)
This defines the current state of the pointer device if it has bee changed by dragging the pointer with button down.


setPointerMovedState

public boolean setPointerMovedState(ResponseEvent e)
This defines the current state of the pointer device if it has bee changed by moving the pointer with button up.


pointerActivated

protected boolean pointerActivated()
This should be overridden by subclasses if they want to intercept pointer activation responses.


pointerDragged

protected boolean pointerDragged()
This should be overridden by subclasses if they want to intercept pointer dragging responses.


pointerMoved

protected boolean pointerMoved()
This should be overridden by subclasses if they want to intercept pointer motion responses.


pointerReleased

protected boolean pointerReleased()
This should be overridden by subclasses if they want to intercept pointer release responses.


screenButtonPressed

protected void screenButtonPressed()
Signal the Display object that the mouse pointer has been pressed inside the screen button area.


screenButtonReleased

protected void screenButtonReleased()
Signal the Display object that the mouse pointer has been released inside the screen button area.


setKeyResponse

public boolean setKeyResponse(java.awt.event.KeyEvent keyEvent)
Signals the display object that a response key has been pressed which was not identical to the StopKey.

Returns:
true if the current timing group should be shown again and false if not.

keyResponse

protected boolean keyResponse(java.awt.event.KeyEvent keyEvent)
This method is here to be overridden by display objects which want to respond to single key strokes which do NOT stop the display timer. The display object may change its appearance and the currently active timing group will be redrawn afterwards.

Returns:
true if the current timing group should be shown again and false if not.

setAxisDeltas

public boolean setAxisDeltas(double[] d)

setPolledButtonStates

public boolean setPolledButtonStates(int cbi,
                                     boolean[] b)

axisDeltasChanged

protected boolean axisDeltasChanged()
This should be overridden by subclasses if they want to intercept polled device axis responses.


buttonsPolled

protected boolean buttonsPolled()
This should be overridden by subclasses if they want to intercept polled button responses.


toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object