Removed additional addNotify() peer hacks.
From-SVN: r38367
This commit is contained in:
parent
2cb5082c1e
commit
be36b6d0dd
6 changed files with 13 additions and 9 deletions
|
@ -38,7 +38,7 @@ public class Button extends Component
|
|||
public void addNotify ()
|
||||
{
|
||||
if (peer == null)
|
||||
peer = (ComponentPeer) getToolkit ().createButton (this);
|
||||
peer = getToolkit ().createButton (this);
|
||||
super.addNotify();
|
||||
}
|
||||
|
||||
|
|
|
@ -1306,8 +1306,6 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
|||
|
||||
private void processPaintEvent(PaintEvent event)
|
||||
{
|
||||
ComponentPeer peer = getPeer();
|
||||
|
||||
// Can't do graphics without peer
|
||||
if (peer == null)
|
||||
return;
|
||||
|
@ -1319,10 +1317,10 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
|||
switch (event.id)
|
||||
{
|
||||
case PaintEvent.PAINT:
|
||||
if (peer != null) paint(gfx);
|
||||
paint(gfx);
|
||||
break;
|
||||
case PaintEvent.UPDATE:
|
||||
if (peer != null) update(gfx);
|
||||
update(gfx);
|
||||
break;
|
||||
default:
|
||||
throw new IllegalArgumentException("unknown paint event");
|
||||
|
|
|
@ -42,7 +42,7 @@ public class Label extends Component
|
|||
public void addNotify ()
|
||||
{
|
||||
if (peer == null)
|
||||
peer = (ComponentPeer) getToolkit ().createLabel (this);
|
||||
peer = getToolkit ().createLabel (this);
|
||||
}
|
||||
|
||||
public int getAlignment ()
|
||||
|
|
|
@ -32,8 +32,8 @@ public class Panel extends Container
|
|||
|
||||
public void addNotify()
|
||||
{
|
||||
if (getPeer() == null)
|
||||
peer = (ComponentPeer) getToolkit().createPanel(this);
|
||||
if (peer == null)
|
||||
peer = getToolkit().createPanel(this);
|
||||
super.addNotify();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -54,7 +54,7 @@ public class Scrollbar extends Component implements Adjustable
|
|||
public void addNotify ()
|
||||
{
|
||||
if (peer == null)
|
||||
peer = (ComponentPeer) getToolkit ().createScrollbar (this);
|
||||
peer = getToolkit ().createScrollbar (this);
|
||||
}
|
||||
|
||||
public int getOrientation ()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue