net.sf.nachocalendar.components
Class DayPanel
JComponent
net.sf.nachocalendar.components.DayPanel
public class DayPanel
extends JComponent
Component used to display a day. It has to had a renderer to paint itself
DayPanel(DayRenderer renderer, int index) - Creates a new instance of DayPanel.
|
DayPanel
public DayPanel(DayRenderer renderer,
int index)
Creates a new instance of DayPanel.
renderer
- renderer used to paint
getData
public Object getData()
Returns the current data.
getDate
public Date getDate()
Return the displaying date.
getIndex
public int getIndex()
Getter for property index.
getRenderer
public DayRenderer getRenderer()
Getter for property renderer.
- Value of property renderer.
isAntiAliased
public boolean isAntiAliased()
isComponentEnabled
public boolean isComponentEnabled()
Getter for property componentEnabled.
- Value of property componentEnabled.
isEnabled
public boolean isEnabled()
Getter for property enabled.
- Value of property enabled.
isPrintMoon
public boolean isPrintMoon()
isSelected
public boolean isSelected()
Getter for property selected.
- Value of property selected.
isWorking
public boolean isWorking()
Getter for property working.
- Value of property working.
paint
public void paint(Graphics g)
Invoked by Swing to draw components.
Applications should not invoke
paint
directly,
but should instead use the
repaint
method to
schedule the component for redrawing.
This method actually delegates the work of painting to three
protected methods:
paintComponent
,
paintBorder
,
and
paintChildren
. They're called in the order
listed to ensure that children appear on top of component itself.
Generally speaking, the component and its children should not
paint in the insets area allocated to the border. Subclasses can
just override this method, as always. A subclass that just
wants to specialize the UI (look and feel) delegate's
paint
method should just override
paintComponent
.
g
- the Graphics
context in which to paint
setAntiAliased
public void setAntiAliased(boolean antiAliased)
antiAliased
- The antiAliased to set.
setComponentEnabled
public void setComponentEnabled(boolean componentEnabled)
Setter for property componentEnabled.
componentEnabled
- New value of property componentEnabled.
setData
public void setData(Object d)
Sets the current data.
setDate
public void setDate(Date d)
Sets the displaying date.
setEnabled
public void setEnabled(boolean enabled)
Setter for property enabled.
enabled
- New value of property enabled.
setIndex
public void setIndex(int index)
Setter for property index.
index
- New value of property index.
setPrintMoon
public void setPrintMoon(boolean printMoon)
printMoon
- The printMoon to set.
setRenderer
public void setRenderer(DayRenderer renderer)
Setter for property renderer.
renderer
- New value of property renderer.
setSelected
public void setSelected(boolean selected)
Setter for property selected.
selected
- New value of property selected.
setWorking
public void setWorking(boolean working)
Setter for property working.
working
- New value of property working.