Motorola i325 Spezifikationen Seite 125

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 161
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 124
iDEN i325 J2ME™ Developers’ Guide
Page 125
2004 Motorola, Inc.
else
{
h = tvh;
}
// consider the height of the image
int ih = img.getHeight();
if (ih > h)
{
h = ih;
}
return h;
}
// paint the radio-button/checkbox, etc.
public void paint(Graphics g, Object[] params,
int width, int height, int mode)
{
// don’t need to clear the background, it was cleared by
// the Displayable that contains this ChoiceGroup option
// determine if the item is selected
boolean selected = (mode & ITEM_LNF_STATE_SELECTED != 0);
// determine if the item is highlighted (has focus)
boolean focused = (mode & ITEM_LNF_STATE_HIGHLIGHTED != 0);
// render the focused rectangle/highlighting
if (focused)
{
// use the highlighting color
g.setColor(getColor(ColorPalette.HIGHLIGHTED_FILL_COLOR));
g.fillRect(0, 0, width, height);
}
// set the default foreground color
g.setColor(getColor(ColorPalette.FOREGROUND_COLOR));
// render the radio-button or checkbox (if applicable)
int size = font.getHeight();
switch (mode & ITEM_LNF_ASPECT_MASK)
{
case ITEM_LNF_ASPECT_RADIOBUTTON:
// outer rectangle
g.drawRect(0, 0, size-1, size-1);
// inner rectangle, if selected
g.drawRect(1, 1, size-3, size-3);
if (selected)
{
g.fillRect(1, 1, size-2, size-2);
}
Seitenansicht 124
1 2 ... 120 121 122 123 124 125 126 127 128 129 130 ... 160 161

Kommentare zu diesen Handbüchern

Keine Kommentare