Class CalendarButtonBorder
- java.lang.Object
-
- io.github.jonestimd.swing.component.AbstractButtonBorder<javax.swing.JFormattedTextField,CalendarPanel>
-
- io.github.jonestimd.swing.component.CalendarButtonBorder
-
- All Implemented Interfaces:
javax.swing.border.Border
public class CalendarButtonBorder extends AbstractButtonBorder<javax.swing.JFormattedTextField,CalendarPanel>
The border for aDateField. This border contains a calendar "button" that allows the user to select a date in aCalendarPanelwhen the "button" is clicked.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class io.github.jonestimd.swing.component.AbstractButtonBorder
AbstractButtonBorder.Side
-
-
Constructor Summary
Constructors Constructor Description CalendarButtonBorder(javax.swing.JFormattedTextField textField)CalendarButtonBorder(javax.swing.JFormattedTextField textField, java.util.ResourceBundle bundle)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.awt.PointgetPopupLocation(java.awt.Dimension screenSize, java.awt.Dimension popupSize, javax.swing.JFormattedTextField borderComponent)Calculate the location to display the popup.protected voidinitializePopup(javax.swing.JFormattedTextField borderComponent, CalendarPanel popupComponent)Initialize the content of the popup window.protected voidpaintBorder(java.awt.Component c, java.awt.Graphics g, int x, int y, int width, int height, int inset)Paint the border, including the "button".-
Methods inherited from class io.github.jonestimd.swing.component.AbstractButtonBorder
getBorderInsets, hidePopup, isBorderOpaque, isOverButton, paintBorder, preparePopupPanel, setTooltip, showPopup
-
-
-
-
Method Detail
-
initializePopup
protected void initializePopup(javax.swing.JFormattedTextField borderComponent, CalendarPanel popupComponent)Description copied from class:AbstractButtonBorderInitialize the content of the popup window.- Specified by:
initializePopupin classAbstractButtonBorder<javax.swing.JFormattedTextField,CalendarPanel>- Parameters:
borderComponent- the contained componentpopupComponent- the popup window content panel
-
paintBorder
protected void paintBorder(java.awt.Component c, java.awt.Graphics g, int x, int y, int width, int height, int inset)Description copied from class:AbstractButtonBorderPaint the border, including the "button".- Specified by:
paintBorderin classAbstractButtonBorder<javax.swing.JFormattedTextField,CalendarPanel>- Parameters:
c- the component for which this border is being paintedg- the paint graphicsx- the x position of the painted bordery- the y position of the painted borderwidth- the width of the painted borderheight- the height of the painted borderinset- the width of the "button"
-
getPopupLocation
protected java.awt.Point getPopupLocation(java.awt.Dimension screenSize, java.awt.Dimension popupSize, javax.swing.JFormattedTextField borderComponent)Description copied from class:AbstractButtonBorderCalculate the location to display the popup.- Specified by:
getPopupLocationin classAbstractButtonBorder<javax.swing.JFormattedTextField,CalendarPanel>- Parameters:
screenSize- the size of the screenpopupSize- the size of the popup windowborderComponent- the contained component- Returns:
- the location to use to display the popup
-
-