Class PMIWeekView
java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
com.inductiveautomation.vision.api.client.components.model.AbstractVisionPanel
com.inductiveautomation.factorypmi.application.components.PMIWeekView
- All Implemented Interfaces:
DynamicPropertyProvider
,LocaleListener
,MutableDynamicPropertyProvider
,StyleProvider
,ComponentLifecycle
,DesignerInitializable
,QualityMonitor
,VisionComponent
,ActionListener
,MouseListener
,MouseMotionListener
,ImageObserver
,MenuContainer
,Serializable
,EventListener
,Accessible
- Direct Known Subclasses:
ScheduleView
public class PMIWeekView
extends AbstractVisionPanel
implements MouseListener, DesignerInitializable, ComponentLifecycle, ActionListener, MouseMotionListener, LocaleListener
- See Also:
-
Nested Class Summary
Nested ClassesNested 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.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
-
Field Summary
FieldsFields inherited from class com.inductiveautomation.vision.api.client.components.model.AbstractVisionPanel
antialias, context, cursorCode, dynamicProps
Fields inherited from class javax.swing.JComponent
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
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
Fields inherited from interface com.inductiveautomation.vision.api.client.components.model.ComponentLifecycle
COMPONENT_RUNNING
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
Fields inherited from interface com.inductiveautomation.ignition.client.model.LocaleListener
LOCAL_CHANGE_EVENT
Fields inherited from interface com.inductiveautomation.vision.api.client.binding.MutableDynamicPropertyProvider
RESERVED_SET_KEY
Fields inherited from interface com.inductiveautomation.vision.api.client.components.model.VisionComponent
COMPONENT_LOCKED, COMPONENT_PERMISSIONS, COMPONENT_SECURITY, COMPONENT_TRANSLATIONS
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
protected JComponent
createComponent
(EventItem item, Date startDate, Date endDate) protected com.inductiveautomation.factorypmi.application.components.PMIWeekView.DayInfo
findDayAt
(int x, int y) findEventsForDay
(Date day) protected PMIWeekView.TimeInfo
findTimeAt
(int x, int y) int
int
getCal()
com.inductiveautomation.factorypmi.application.components.PMIWeekView.DayInfo
int
getDay()
Gets the text color for objects on this view.int
int
protected int
Overridden in subclasses to display events on separate layers rather than side-by-sideint
getMonth()
int
int
int
int
getYear()
void
protected void
initUI()
boolean
boolean
boolean
boolean
boolean
boolean
void
localeChanged
(Locale newLocale) static void
void
void
void
void
void
void
The EventBox components add this as a mouse listener, so these are listening to the event boxes themselvesvoid
protected void
Subclasses should override this to provide shutdown logic.protected void
Subclasses should override this to provide startup logic.protected void
paintCalendar
(Graphics2D g, int x, int y, int w, int h) protected void
protected void
paintComponent
(Graphics graphics) protected void
paintWeekDays
(Graphics2D g, int x, int y, int w, int h) void
setAutoZoom
(boolean autoZoom) void
setAutoZoomEndHour
(int autoZoomEndHour) void
setAutoZoomStartHour
(int autoZoomStartHour) protected final void
Sets the calendar to 00:00:00.000 (12 AM)void
setBoxOutline
(Color boxOutline) void
setCalendarBackground
(Color calendarBackground) void
setCurrentDay
(com.inductiveautomation.factorypmi.application.components.PMIWeekView.DayInfo currentDay) void
setCurrentEvent
(EventBox currentEvent) void
setDate
(int year, int month, int day) Sets the year, month and day all at once in order to avoid updating the internal calendar one field at a time, waiting until the end of the method to fire property changes and reinit the UI.void
setDay
(int day) protected final void
setEndOfDay
(Calendar cal) Sets the calendar to 23:59:59 (11:59 PM)void
setEventFont
(Font eventFont) void
setEventForeground
(Color color) Sets the text color for objects on this view.void
void
setGridMarks
(int gridMarks) void
setHourFont
(Font hourFont) void
setHourForeground
(Color hourForeground) void
setHoverBackground
(Color hoverBackground) void
setHoveredDay
(String hoveredDay) void
setHoveredDayOnly
(String hoveredDay) void
setHoveredEvent
(int hoveredEvent) void
setHoveredEventOnly
(int hoveredEvent) void
setHoveredTime
(String hoveredTime) void
setHoveredTimeOnly
(String hoveredTime) void
setMonth
(int month) void
setNonWorkingHourBackground
(Color nonWorkingHourBackground) void
setSelectedBackground
(Color selectedBackground) void
setSelectedDay
(String selectedDay) void
setSelectedDayOnly
(String selectedDay) void
setSelectedEvent
(int selectedEvent) void
setSelectedEventOnly
(int selectedEvent) void
setShowEventTime
(boolean showTime) void
setShowWeekend
(boolean showWeekend) void
setTodayBackground
(Color todayBackground) void
setTwentyFourHour
(boolean twentyFourHour) void
setUseLocaleTimeFormat
(boolean useLocaleTimeFormat) void
setWeekdayFont
(Font weekdayFont) void
setWeekDaysBackground
(Color weekDaysBackground) void
setWeekDaysForeground
(Color weekDaysForeground) void
setWorkingEndHour
(int workingEndHour) void
setWorkingStartHour
(int workingStartHour) void
setYear
(int year) void
updateDateInfo
(Locale locale) Methods inherited from class com.inductiveautomation.vision.api.client.components.model.AbstractVisionPanel
getAppContext, getCursorCode, getDataQuality, getDynamicProps, getProperties, getPropertyValue, getQuality, getStyles, getToolTipText, initStyleListener, isAntialias, isComponentRunning, isPropertyDefined, paintOverlayOverChildren, setAntialias, setCursorCode, setDataQuality, setDynamicProps, setName, setPropertyValue, setQuality, setStyles, setToolTipText, setVisible, shutdownComponent, startupComponent, translate, updateQuality
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, unregisterKeyboardAction, update
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.inductiveautomation.vision.api.client.components.model.ComponentLifecycle
getAppContext, shutdownComponent, startupComponent
-
Field Details
-
todayDate
-
-
Constructor Details
-
PMIWeekView
public PMIWeekView()
-
-
Method Details
-
isOptimizedDrawingEnabled
public boolean isOptimizedDrawingEnabled()- Overrides:
isOptimizedDrawingEnabled
in classJComponent
-
isFocusable
public boolean isFocusable()- Overrides:
isFocusable
in classComponent
-
actionPerformed
- Specified by:
actionPerformed
in interfaceActionListener
-
onStartup
protected void onStartup()Description copied from class:AbstractVisionPanel
Subclasses should override this to provide startup logic.- Overrides:
onStartup
in classAbstractVisionPanel
-
onShutdown
protected void onShutdown()Description copied from class:AbstractVisionPanel
Subclasses should override this to provide shutdown logic.- Overrides:
onShutdown
in classAbstractVisionPanel
-
initUI
protected void initUI() -
setBeginningOfDay
Sets the calendar to 00:00:00.000 (12 AM) -
setEndOfDay
Sets the calendar to 23:59:59 (11:59 PM) -
getLayer
Overridden in subclasses to display events on separate layers rather than side-by-side -
findEventsForDay
-
createComponent
-
main
-
getEvents
-
setEvents
-
isAutoZoom
public boolean isAutoZoom() -
setAutoZoom
public void setAutoZoom(boolean autoZoom) -
isShowEventTime
public boolean isShowEventTime() -
setShowEventTime
public void setShowEventTime(boolean showTime) -
getAutoZoomStartHour
public int getAutoZoomStartHour() -
setAutoZoomStartHour
public void setAutoZoomStartHour(int autoZoomStartHour) -
getAutoZoomEndHour
public int getAutoZoomEndHour() -
setAutoZoomEndHour
public void setAutoZoomEndHour(int autoZoomEndHour) -
getWorkingStartHour
public int getWorkingStartHour() -
setWorkingStartHour
public void setWorkingStartHour(int workingStartHour) -
getWorkingEndHour
public int getWorkingEndHour() -
setWorkingEndHour
public void setWorkingEndHour(int workingEndHour) -
getGridMarks
public int getGridMarks() -
setGridMarks
public void setGridMarks(int gridMarks) -
setDate
public void setDate(int year, int month, int day) Sets the year, month and day all at once in order to avoid updating the internal calendar one field at a time, waiting until the end of the method to fire property changes and reinit the UI. Otherwise an exception can be thrown when going to a month with fewer days than the current month when you happen to be on the day that doesn't exist. (e.g. 3/31 -> 4/x)- Parameters:
year
- >= 0month
- 1-12day
- 1-31
-
getDay
public int getDay() -
setDay
public void setDay(int day) -
getMonth
public int getMonth() -
setMonth
public void setMonth(int month) -
getYear
public int getYear() -
setYear
public void setYear(int year) -
getSelectedDay
-
setSelectedDayOnly
-
setSelectedDay
-
getHoveredDay
-
setHoveredDay
-
setHoveredDayOnly
-
getHoveredTime
-
setHoveredTime
-
setHoveredTimeOnly
-
getSelectedEvent
public int getSelectedEvent() -
setSelectedEventOnly
public void setSelectedEventOnly(int selectedEvent) -
setSelectedEvent
public void setSelectedEvent(int selectedEvent) -
getHoveredEvent
public int getHoveredEvent() -
setHoveredEvent
public void setHoveredEvent(int hoveredEvent) -
setHoveredEventOnly
public void setHoveredEventOnly(int hoveredEvent) -
getCurrentDay
public com.inductiveautomation.factorypmi.application.components.PMIWeekView.DayInfo getCurrentDay() -
setCurrentDay
public void setCurrentDay(com.inductiveautomation.factorypmi.application.components.PMIWeekView.DayInfo currentDay) -
getCurrentEvent
-
setCurrentEvent
-
setEventFont
-
getEventFont
-
setEventForeground
Sets the text color for objects on this view.- Parameters:
color
- the color to set
-
getEventForeground
Gets the text color for objects on this view.- Returns:
- the
Color
that is currently set. Will not be null
-
setHourFont
-
getHourFont
-
getWeekdayFont
-
setWeekdayFont
-
getWeekDaysForeground
-
setWeekDaysForeground
-
getWeekDaysBackground
-
setWeekDaysBackground
-
getBoxOutline
-
setBoxOutline
-
getCalendarBackground
-
setCalendarBackground
-
getTodayBackground
-
setTodayBackground
-
getSelectedBackground
-
setSelectedBackground
-
getHoverBackground
-
setHoverBackground
-
getHourForeground
-
setHourForeground
-
getNonWorkingHourBackground
-
setNonWorkingHourBackground
-
isTwentyFourHour
public boolean isTwentyFourHour() -
setTwentyFourHour
public void setTwentyFourHour(boolean twentyFourHour) -
setUseLocaleTimeFormat
public void setUseLocaleTimeFormat(boolean useLocaleTimeFormat) -
isShowWeekend
public boolean isShowWeekend() -
setShowWeekend
public void setShowWeekend(boolean showWeekend) -
mouseDragged
- Specified by:
mouseDragged
in interfaceMouseMotionListener
-
mouseMoved
- Specified by:
mouseMoved
in interfaceMouseMotionListener
-
mouseClicked
- Specified by:
mouseClicked
in interfaceMouseListener
-
mouseEntered
- Specified by:
mouseEntered
in interfaceMouseListener
-
mouseExited
- Specified by:
mouseExited
in interfaceMouseListener
-
mousePressed
The EventBox components add this as a mouse listener, so these are listening to the event boxes themselves- Specified by:
mousePressed
in interfaceMouseListener
-
mouseReleased
- Specified by:
mouseReleased
in interfaceMouseListener
-
findDayAt
protected com.inductiveautomation.factorypmi.application.components.PMIWeekView.DayInfo findDayAt(int x, int y) -
findTimeAt
-
paintComponent
- Overrides:
paintComponent
in classAbstractVisionPanel
-
paintWeekDays
-
paintChildren
- Overrides:
paintChildren
in classAbstractVisionPanel
-
paintCalendar
-
getCal
-
initialize
public void initialize()- Specified by:
initialize
in interfaceDesignerInitializable
-
localeChanged
- Specified by:
localeChanged
in interfaceLocaleListener
- Overrides:
localeChanged
in classAbstractVisionPanel
-
updateDateInfo
-