public class BlockTimeLineNode extends Object implements TimeLineNode
This code was developed by NASA, Goddard Space Flight Center, Code 588 for the Scientist's Expert Assistant (SEA) project.
Modifier and Type | Field and Description |
---|---|
protected VetoableChangeSupport |
fChangeSupport |
protected Rectangle2D.Float |
fThumb |
BIC, DEFAULT_FONT, DEFAULT_LABEL_SPACE, END_TIME, HIT_LEFT_EDGE, HIT_RIGHT_EDGE, LEFT_HANDLE_SELECTED, MODE, MOVE_CURSOR, NAME, NODE, NODE_MAX_SIZE_EXCEEDED, NODE_MIN_SIZE_EXCEEDED, NODE_OVERLAP, NODE_SELECTED, REVERSE_ROTATED_FONT, RIGHT_HANDLE_SELECTED, ROTATED_FONT, SELECTED_COLOR, START_TIME, UNSELECTED, UNSELECTED_COLOR
Constructor and Description |
---|
BlockTimeLineNode(Time start,
Time end)
constructor
|
BlockTimeLineNode(Time startTime,
Time endTime,
String name) |
Modifier and Type | Method and Description |
---|---|
void |
addVetoableChangeListener(VetoableChangeListener listener)
add a property change listener to the node
|
protected void |
calculateNodeDimensions()
calculate thumb's dimensions in pixels
|
boolean |
containsPoint(Point pt)
returns whether the specified point is in the node
|
int |
getAreaForPoint(Point pt)
returns what area of a time line node a point exists in
|
Point |
getCenterPoint()
returns the center point for the time line node
|
Cursor |
getCursor(MouseEvent evt)
get the cursor for the specified point
|
String |
getDescription(Point pt)
returns a description for the area at the specified point
|
Time |
getDuration()
get the duration of the time line node
|
Time |
getEndTime()
get the time on the time line that this node ends
|
TimeLineNodeModel |
getModel()
get the node's underlying model
|
TimeLine |
getParent()
get the parent time line
|
Color |
getSelectedColor()
get the the selected color the time line node
|
int |
getSelectionMode()
get the selection mode of the time line node
|
Time |
getStartTime()
get the time on the time line that this node starts
|
String |
getTimeLineNodeName()
get the name of the time line node
|
Color |
getUnselectedColor()
get the the unselected color the time line node
|
void |
handleKeyEvent(KeyEvent evt)
handle key event
|
void |
handleMouseDragEvent(MouseEvent evt)
handle mouse events
|
void |
handleMouseEvent(MouseEvent evt)
handle mouse events
|
void |
handleMouseMoveEvent(MouseEvent evt)
handle mouse events
|
boolean |
intersects(TimeLineNode node)
returns whether the node intersects the passed in node
|
boolean |
isDragging()
returns whether the node is currently being dragged
|
boolean |
isSelected()
returns whther the node is currently selected
|
void |
moveTimeLineNodeBy(Time time)
move node by specified amount
|
void |
paintTimeLineNode(Graphics2D graphics)
paint the time line node
|
void |
removeVetoableChangeListener(VetoableChangeListener listener)
remove a propertyChangeListener to the node
|
void |
revertToPrevious()
revert the time line node to its previous position
|
void |
setDuration(Time durationLength)
set the duration of the time line node
|
void |
setEndTime(Time time)
set the time on the time line that this node ends
|
void |
setModel(TimeLineNodeModel model)
set the time line node's underlying model
|
void |
setParent(TimeLine timeLine)
set the parent time line
|
void |
setSelectedColor(Color color)
set the selected color for the time line node
|
void |
setSelectionMode(int mode)
set the selection mode of the time linenode
|
void |
setStartTime(Time time)
set the time that this node starts
|
void |
setTimeLineNode(Time start,
Time end)
move node to a specified location
|
void |
setTimeLineNodeName(String name)
give the time line node a name
|
void |
setUnselectedColor(Color color)
set the unselected color for the time line node
|
String |
toString() |
void |
vetoableChange(PropertyChangeEvent evt) |
protected VetoableChangeSupport fChangeSupport
protected Rectangle2D.Float fThumb
public void setSelectionMode(int mode)
setSelectionMode
in interface TimeLineNode
public int getSelectionMode()
getSelectionMode
in interface TimeLineNode
public void setUnselectedColor(Color color)
setUnselectedColor
in interface TimeLineNode
public Color getUnselectedColor()
getUnselectedColor
in interface TimeLineNode
public void setSelectedColor(Color color)
setSelectedColor
in interface TimeLineNode
public Color getSelectedColor()
getSelectedColor
in interface TimeLineNode
public Time getStartTime()
getStartTime
in interface TimeLineNode
public void setStartTime(Time time) throws DetailedPropertyVetoException
setStartTime
in interface TimeLineNode
DetailedPropertyVetoException
public void moveTimeLineNodeBy(Time time) throws DetailedPropertyVetoException
moveTimeLineNodeBy
in interface TimeLineNode
DetailedPropertyVetoException
public Time getEndTime()
getEndTime
in interface TimeLineNode
public void setEndTime(Time time) throws DetailedPropertyVetoException
setEndTime
in interface TimeLineNode
DetailedPropertyVetoException
public Time getDuration()
getDuration
in interface TimeLineNode
public void setDuration(Time durationLength) throws DetailedPropertyVetoException
setDuration
in interface TimeLineNode
DetailedPropertyVetoException
public void paintTimeLineNode(Graphics2D graphics)
paintTimeLineNode
in interface TimeLineNode
graphics
- the graphics component to paintpublic void handleMouseEvent(MouseEvent evt)
handleMouseEvent
in interface TimeLineNode
public void handleMouseDragEvent(MouseEvent evt)
handleMouseDragEvent
in interface TimeLineNode
public void handleMouseMoveEvent(MouseEvent evt)
handleMouseMoveEvent
in interface TimeLineNode
public void handleKeyEvent(KeyEvent evt) throws DetailedPropertyVetoException
handleKeyEvent
in interface TimeLineNode
DetailedPropertyVetoException
public void setTimeLineNodeName(String name)
setTimeLineNodeName
in interface TimeLineNode
public String getTimeLineNodeName()
getTimeLineNodeName
in interface TimeLineNode
public void setParent(TimeLine timeLine)
setParent
in interface TimeLineNode
public TimeLine getParent()
getParent
in interface TimeLineNode
protected void calculateNodeDimensions()
public boolean isDragging()
isDragging
in interface TimeLineNode
public boolean isSelected()
isSelected
in interface TimeLineNode
public void revertToPrevious()
revertToPrevious
in interface TimeLineNode
public void vetoableChange(PropertyChangeEvent evt) throws DetailedPropertyVetoException
vetoableChange
in interface VetoableChangeListener
DetailedPropertyVetoException
public int getAreaForPoint(Point pt)
getAreaForPoint
in interface TimeLineNode
public boolean intersects(TimeLineNode node)
intersects
in interface TimeLineNode
public Point getCenterPoint()
getCenterPoint
in interface TimeLineNode
public void setTimeLineNode(Time start, Time end) throws DetailedPropertyVetoException
setTimeLineNode
in interface TimeLineNode
DetailedPropertyVetoException
public boolean containsPoint(Point pt)
containsPoint
in interface TimeLineNode
public String getDescription(Point pt)
getDescription
in interface TimeLineNode
public void addVetoableChangeListener(VetoableChangeListener listener)
addVetoableChangeListener
in interface TimeLineNode
public void removeVetoableChangeListener(VetoableChangeListener listener)
removeVetoableChangeListener
in interface TimeLineNode
public TimeLineNodeModel getModel()
getModel
in interface TimeLineNode
public void setModel(TimeLineNodeModel model)
setModel
in interface TimeLineNode
public Cursor getCursor(MouseEvent evt)
getCursor
in interface TimeLineNode
Copyright © 2023 Central Laboratory of the Research Councils. All Rights Reserved.