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.AccessibleJPanelNested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponentNested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainerNested 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, dynamicPropsFields inherited from class javax.swing.JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWFields inherited from class java.awt.Component
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTFields inherited from interface com.inductiveautomation.vision.api.client.components.model.ComponentLifecycle
COMPONENT_RUNNINGFields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTHFields inherited from interface com.inductiveautomation.ignition.client.model.LocaleListener
LOCAL_CHANGE_EVENTFields inherited from interface com.inductiveautomation.vision.api.client.binding.MutableDynamicPropertyProvider
RESERVED_SET_KEYFields 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 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.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, updateQualityMethods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUIMethods 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, updateMethods 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, validateTreeMethods 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, transferFocusUpCycleMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods 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:
isOptimizedDrawingEnabledin classJComponent
-
isFocusable
public boolean isFocusable()- Overrides:
isFocusablein classComponent
-
actionPerformed
- Specified by:
actionPerformedin interfaceActionListener
-
onStartup
protected void onStartup()Description copied from class:AbstractVisionPanelSubclasses should override this to provide startup logic.- Overrides:
onStartupin classAbstractVisionPanel
-
onShutdown
protected void onShutdown()Description copied from class:AbstractVisionPanelSubclasses should override this to provide shutdown logic.- Overrides:
onShutdownin 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
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
-
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:
mouseDraggedin interfaceMouseMotionListener
-
mouseMoved
- Specified by:
mouseMovedin interfaceMouseMotionListener
-
mouseClicked
- Specified by:
mouseClickedin interfaceMouseListener
-
mouseEntered
- Specified by:
mouseEnteredin interfaceMouseListener
-
mouseExited
- Specified by:
mouseExitedin interfaceMouseListener
-
mousePressed
The EventBox components add this as a mouse listener, so these are listening to the event boxes themselves- Specified by:
mousePressedin interfaceMouseListener
-
mouseReleased
- Specified by:
mouseReleasedin interfaceMouseListener
-
findDayAt
protected com.inductiveautomation.factorypmi.application.components.PMIWeekView.DayInfo findDayAt(int x, int y) -
findTimeAt
-
paintComponent
- Overrides:
paintComponentin classAbstractVisionPanel
-
paintWeekDays
-
paintChildren
- Overrides:
paintChildrenin classAbstractVisionPanel
-
paintCalendar
-
getCal
-
initialize
public void initialize()- Specified by:
initializein interfaceDesignerInitializable
-
localeChanged
- Specified by:
localeChangedin interfaceLocaleListener- Overrides:
localeChangedin classAbstractVisionPanel
-
updateDateInfo
-