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 SummaryNested ClassesNested classes/interfaces inherited from class javax.swing.JPanelJPanel.AccessibleJPanelNested classes/interfaces inherited from class javax.swing.JComponentJComponent.AccessibleJComponentNested classes/interfaces inherited from class java.awt.ContainerContainer.AccessibleAWTContainerNested classes/interfaces inherited from class java.awt.ComponentComponent.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
- 
Field SummaryFieldsFields inherited from class com.inductiveautomation.vision.api.client.components.model.AbstractVisionPanelantialias, context, cursorCode, dynamicPropsFields inherited from class javax.swing.JComponentlistenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWFields inherited from class java.awt.ComponentaccessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTFields inherited from interface com.inductiveautomation.vision.api.client.components.model.ComponentLifecycleCOMPONENT_RUNNINGFields inherited from interface java.awt.image.ImageObserverABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTHFields inherited from interface com.inductiveautomation.ignition.client.model.LocaleListenerLOCAL_CHANGE_EVENTFields inherited from interface com.inductiveautomation.vision.api.client.binding.MutableDynamicPropertyProviderRESERVED_SET_KEYFields inherited from interface com.inductiveautomation.vision.api.client.components.model.VisionComponentCOMPONENT_LOCKED, COMPONENT_PERMISSIONS, COMPONENT_SECURITY, COMPONENT_TRANSLATIONS
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidprotected JComponentcreateComponent(EventItem item, Date startDate, Date endDate) protected com.inductiveautomation.factorypmi.application.components.PMIWeekView.DayInfofindDayAt(int x, int y) findEventsForDay(Date day) protected PMIWeekView.TimeInfofindTimeAt(int x, int y) intintgetCal()com.inductiveautomation.factorypmi.application.components.PMIWeekView.DayInfointgetDay()Gets the text color for objects on this view.intintprotected intOverridden in subclasses to display events on separate layers rather than side-by-sideintgetMonth()intintintintgetYear()voidprotected voidinitUI()booleanbooleanbooleanbooleanbooleanbooleanvoidlocaleChanged(Locale newLocale) static voidvoidvoidvoidvoidvoidvoidThe EventBox components add this as a mouse listener, so these are listening to the event boxes themselvesvoidprotected voidSubclasses should override this to provide shutdown logic.protected voidSubclasses should override this to provide startup logic.protected voidpaintCalendar(Graphics2D g, int x, int y, int w, int h) protected voidprotected voidpaintComponent(Graphics graphics) protected voidpaintWeekDays(Graphics2D g, int x, int y, int w, int h) voidsetAutoZoom(boolean autoZoom) voidsetAutoZoomEndHour(int autoZoomEndHour) voidsetAutoZoomStartHour(int autoZoomStartHour) protected final voidSets the calendar to 00:00:00.000 (12 AM)voidsetBoxOutline(Color boxOutline) voidsetCalendarBackground(Color calendarBackground) voidsetCurrentDay(com.inductiveautomation.factorypmi.application.components.PMIWeekView.DayInfo currentDay) voidsetCurrentEvent(EventBox currentEvent) voidsetDate(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.voidsetDay(int day) protected final voidsetEndOfDay(Calendar cal) Sets the calendar to 23:59:59 (11:59 PM)voidsetEventFont(Font eventFont) voidsetEventForeground(Color color) Sets the text color for objects on this view.voidvoidsetGridMarks(int gridMarks) voidsetHourFont(Font hourFont) voidsetHourForeground(Color hourForeground) voidsetHoverBackground(Color hoverBackground) voidsetHoveredDay(String hoveredDay) voidsetHoveredDayOnly(String hoveredDay) voidsetHoveredEvent(int hoveredEvent) voidsetHoveredEventOnly(int hoveredEvent) voidsetHoveredTime(String hoveredTime) voidsetHoveredTimeOnly(String hoveredTime) voidsetMonth(int month) voidsetNonWorkingHourBackground(Color nonWorkingHourBackground) voidsetSelectedBackground(Color selectedBackground) voidsetSelectedDay(String selectedDay) voidsetSelectedDayOnly(String selectedDay) voidsetSelectedEvent(int selectedEvent) voidsetSelectedEventOnly(int selectedEvent) voidsetShowEventTime(boolean showTime) voidsetShowWeekend(boolean showWeekend) voidsetTodayBackground(Color todayBackground) voidsetTwentyFourHour(boolean twentyFourHour) voidsetUseLocaleTimeFormat(boolean useLocaleTimeFormat) voidsetWeekdayFont(Font weekdayFont) voidsetWeekDaysBackground(Color weekDaysBackground) voidsetWeekDaysForeground(Color weekDaysForeground) voidsetWorkingEndHour(int workingEndHour) voidsetWorkingStartHour(int workingStartHour) voidsetYear(int year) voidupdateDateInfo(Locale locale) Methods inherited from class com.inductiveautomation.vision.api.client.components.model.AbstractVisionPanelgetAppContext, 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, updateQualityMethods inherited from class javax.swing.JPanelgetAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUIMethods inherited from class javax.swing.JComponentaddAncestorListener, 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, updateMethods inherited from class java.awt.Containeradd, 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, validateTreeMethods inherited from class java.awt.Componentaction, 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, transferFocusUpCycleMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.inductiveautomation.vision.api.client.components.model.ComponentLifecyclegetAppContext, shutdownComponent, startupComponent
- 
Field Details- 
todayDate
 
- 
- 
Constructor Details- 
PMIWeekViewpublic PMIWeekView()
 
- 
- 
Method Details- 
isOptimizedDrawingEnabledpublic boolean isOptimizedDrawingEnabled()- Overrides:
- isOptimizedDrawingEnabledin class- JComponent
 
- 
isFocusablepublic boolean isFocusable()- Overrides:
- isFocusablein class- Component
 
- 
actionPerformed- Specified by:
- actionPerformedin interface- ActionListener
 
- 
onStartupprotected void onStartup()Description copied from class:AbstractVisionPanelSubclasses should override this to provide startup logic.- Overrides:
- onStartupin class- AbstractVisionPanel
 
- 
onShutdownprotected void onShutdown()Description copied from class:AbstractVisionPanelSubclasses should override this to provide shutdown logic.- Overrides:
- onShutdownin class- AbstractVisionPanel
 
- 
initUIprotected void initUI()
- 
setBeginningOfDaySets the calendar to 00:00:00.000 (12 AM)
- 
setEndOfDaySets the calendar to 23:59:59 (11:59 PM)
- 
getLayerOverridden in subclasses to display events on separate layers rather than side-by-side
- 
findEventsForDay
- 
createComponent
- 
main
- 
getEvents
- 
setEvents
- 
isAutoZoompublic boolean isAutoZoom()
- 
setAutoZoompublic void setAutoZoom(boolean autoZoom) 
- 
isShowEventTimepublic boolean isShowEventTime()
- 
setShowEventTimepublic void setShowEventTime(boolean showTime) 
- 
getAutoZoomStartHourpublic int getAutoZoomStartHour()
- 
setAutoZoomStartHourpublic void setAutoZoomStartHour(int autoZoomStartHour) 
- 
getAutoZoomEndHourpublic int getAutoZoomEndHour()
- 
setAutoZoomEndHourpublic void setAutoZoomEndHour(int autoZoomEndHour) 
- 
getWorkingStartHourpublic int getWorkingStartHour()
- 
setWorkingStartHourpublic void setWorkingStartHour(int workingStartHour) 
- 
getWorkingEndHourpublic int getWorkingEndHour()
- 
setWorkingEndHourpublic void setWorkingEndHour(int workingEndHour) 
- 
getGridMarkspublic int getGridMarks()
- 
setGridMarkspublic void setGridMarks(int gridMarks) 
- 
setDatepublic 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- >= 0
- month- 1-12
- day- 1-31
 
- 
getDaypublic int getDay()
- 
setDaypublic void setDay(int day) 
- 
getMonthpublic int getMonth()
- 
setMonthpublic void setMonth(int month) 
- 
getYearpublic int getYear()
- 
setYearpublic void setYear(int year) 
- 
getSelectedDay
- 
setSelectedDayOnly
- 
setSelectedDay
- 
getHoveredDay
- 
setHoveredDay
- 
setHoveredDayOnly
- 
getHoveredTime
- 
setHoveredTime
- 
setHoveredTimeOnly
- 
getSelectedEventpublic int getSelectedEvent()
- 
setSelectedEventOnlypublic void setSelectedEventOnly(int selectedEvent) 
- 
setSelectedEventpublic void setSelectedEvent(int selectedEvent) 
- 
getHoveredEventpublic int getHoveredEvent()
- 
setHoveredEventpublic void setHoveredEvent(int hoveredEvent) 
- 
setHoveredEventOnlypublic void setHoveredEventOnly(int hoveredEvent) 
- 
getCurrentDaypublic com.inductiveautomation.factorypmi.application.components.PMIWeekView.DayInfo getCurrentDay()
- 
setCurrentDaypublic void setCurrentDay(com.inductiveautomation.factorypmi.application.components.PMIWeekView.DayInfo currentDay) 
- 
getCurrentEvent
- 
setCurrentEvent
- 
setEventFont
- 
getEventFont
- 
setEventForegroundSets the text color for objects on this view.- Parameters:
- color- the color to set
 
- 
getEventForegroundGets the text color for objects on this view.- Returns:
- the Colorthat 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
- 
isTwentyFourHourpublic boolean isTwentyFourHour()
- 
setTwentyFourHourpublic void setTwentyFourHour(boolean twentyFourHour) 
- 
setUseLocaleTimeFormatpublic void setUseLocaleTimeFormat(boolean useLocaleTimeFormat) 
- 
isShowWeekendpublic boolean isShowWeekend()
- 
setShowWeekendpublic void setShowWeekend(boolean showWeekend) 
- 
mouseDragged- Specified by:
- mouseDraggedin interface- MouseMotionListener
 
- 
mouseMoved- Specified by:
- mouseMovedin interface- MouseMotionListener
 
- 
mouseClicked- Specified by:
- mouseClickedin interface- MouseListener
 
- 
mouseEntered- Specified by:
- mouseEnteredin interface- MouseListener
 
- 
mouseExited- Specified by:
- mouseExitedin interface- MouseListener
 
- 
mousePressedThe EventBox components add this as a mouse listener, so these are listening to the event boxes themselves- Specified by:
- mousePressedin interface- MouseListener
 
- 
mouseReleased- Specified by:
- mouseReleasedin interface- MouseListener
 
- 
findDayAtprotected com.inductiveautomation.factorypmi.application.components.PMIWeekView.DayInfo findDayAt(int x, int y) 
- 
findTimeAt
- 
paintComponent- Overrides:
- paintComponentin class- AbstractVisionPanel
 
- 
paintWeekDays
- 
paintChildren- Overrides:
- paintChildrenin class- AbstractVisionPanel
 
- 
paintCalendar
- 
getCal
- 
initializepublic void initialize()- Specified by:
- initializein interface- DesignerInitializable
 
- 
localeChanged- Specified by:
- localeChangedin interface- LocaleListener
- Overrides:
- localeChangedin class- AbstractVisionPanel
 
- 
updateDateInfo
 
-