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 aCalendarPanel
when 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.Point
getPopupLocation(java.awt.Dimension screenSize, java.awt.Dimension popupSize, javax.swing.JFormattedTextField borderComponent)
Calculate the location to display the popup.protected void
initializePopup(javax.swing.JFormattedTextField borderComponent, CalendarPanel popupComponent)
Initialize the content of the popup window.protected void
paintBorder(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:AbstractButtonBorder
Initialize the content of the popup window.- Specified by:
initializePopup
in 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:AbstractButtonBorder
Paint the border, including the "button".- Specified by:
paintBorder
in 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:AbstractButtonBorder
Calculate the location to display the popup.- Specified by:
getPopupLocation
in 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
-
-