|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
se.liu.ida.critiquer.gui.TimeView
public class TimeView
This class presents the time view. It is a bit special since the constraints are notified by the TimeLinePlot and not the view itself. That's because we want to interact with the timeline and therefore it's easier if the input coordinate system is the same as the one used by the activity areas. The constraints are therefore only given the graphics context of the chart area when they display their information.
Interaction in this view goes as follows:
Nested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.JPanel |
---|
JPanel.AccessibleJPanel |
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Container |
---|
Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary | |
---|---|
protected ConstraintComponent |
critiqueComponent
|
Fields inherited from class javax.swing.JComponent |
---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Component |
---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
TimeView()
|
Method Summary | ||
---|---|---|
void |
activityCreated(Activity activity)
The activity has just been created |
|
void |
activityRemoved(Activity a)
The activity was just removed |
|
void |
activityUpdated(Activity a)
The activity has undergone major changes, refresh all information dependent on it. |
|
int |
compareTo(ActivityUpdateListener o)
Put this one after all other update listeners so all changes have taken place when changing the time lines |
|
void |
datasetChanged(DatasetChangeEvent event)
|
|
Rectangle2D |
getActivityArea(Activity activity)
A view should render activities as either components or as Java 2D Shapes. |
|
HashMap<Activity,Rectangle2D> |
getActivityAreas()
|
|
ChartPanel |
getChartPane()
|
|
JPanel |
getConstraintPanel()
All views should let constraints show information as components in a special panel |
|
Calendar |
getCurrentTime()
Retrieves the current time as set by the slider |
|
ArrayList<Activity> |
getEvaluationActivities()
One may select only a set of activities in the Time View for which time charts should be drawn. |
|
Rectangle2D |
getTimeChartArea()
|
|
JPanel |
getTimePanel()
|
|
void |
initSimulation()
|
|
Calendar |
locationToDate(double x)
|
|
|
paramAdded(Activity activity,
Parameter<T> p)
A parameter has been added |
|
|
paramChanged(Activity activity,
Parameter<T> p)
Recalculate the time chart based on when parameters change. |
|
void |
setCurrentTime(Double currentTime)
Adjust the time according to the parameter, which is converted into a date by the plot |
|
void |
updateActivityArea(Comparable key,
Rectangle2D bar)
|
|
void |
updateView(Graphics2D g2)
|
Methods inherited from class javax.swing.JPanel |
---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected ConstraintComponent critiqueComponent
Constructor Detail |
---|
public TimeView()
Method Detail |
---|
public JPanel getConstraintPanel()
View
getConstraintPanel
in interface View
public void updateView(Graphics2D g2)
updateView
in interface View
public void initSimulation()
public void activityUpdated(Activity a)
ActivityUpdateListener
activityUpdated
in interface ActivityUpdateListener
a
- The activity to set.public ArrayList<Activity> getEvaluationActivities()
getEvaluationActivities
in interface View
public void datasetChanged(DatasetChangeEvent event)
datasetChanged
in interface DatasetChangeListener
public void activityCreated(Activity activity)
ActivityUpdateListener
activityCreated
in interface ActivityUpdateListener
public <T> void paramAdded(Activity activity, Parameter<T> p)
ActivityUpdateListener
paramAdded
in interface ActivityUpdateListener
public <T> void paramChanged(Activity activity, Parameter<T> p)
paramChanged
in interface ActivityUpdateListener
public void activityRemoved(Activity a)
ActivityUpdateListener
activityRemoved
in interface ActivityUpdateListener
public Calendar getCurrentTime()
TimeLinePlot.getCurrentTime()
public void setCurrentTime(Double currentTime)
TimeLinePlot.setCurrentTime(java.lang.Double)
public Rectangle2D getTimeChartArea()
public Calendar locationToDate(double x)
public ChartPanel getChartPane()
public JPanel getTimePanel()
public HashMap<Activity,Rectangle2D> getActivityAreas()
public void updateActivityArea(Comparable key, Rectangle2D bar)
updateActivityArea
in interface TimeLineRenderingListener
public Rectangle2D getActivityArea(Activity activity)
View
getActivityArea
in interface View
public int compareTo(ActivityUpdateListener o)
compareTo
in interface Comparable<ActivityUpdateListener>
java.lang.Comparable#compareTo(T)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |