LWComponentPeer.java revision 4767
private boolean visible = false;
private boolean enabled = true;
private volatile boolean isLayouting;
public boolean isLightweight() {
return getLocationOnScreen();
public int getX() {
return getLocation().x;
public int getY() {
return getLocation().y;
synchronized (getDelegateLock()) {
public void addDirtyRegion(final JComponent c, final int x, final int y, final int w, final int h) {
synchronized (getDelegateLock()) {
} catch (Exception e) {
} catch (Exception e) {
return null;
protected D createDelegate() {
return null;
protected final D getDelegate() {
synchronized (getStateLock()) {
return delegate;
return getDelegate();
public void initialize() {
synchronized (getDelegateLock()) {
return stateLock;
return peerTreeLock;
final T getTarget() {
return target;
return windowPeer;
return getWindowPeer();
return containerPeer;
protected void initializeContainerPeer() {
public void dispose() {
disposeImpl();
protected void disposeImpl() {
public final boolean isDisposed() {
: getOffscreenGraphics();
if (g != null) {
synchronized (getPeerTreeLock()){
applyConstrain(g);
getFont());
getFont());
if (c == null) {
c = c.getIntersection(r);
if (p != null) {
return region;
throws AWTException {
return null;
public void destroyBuffers() {
final boolean updateTarget) {
synchronized (getStateLock()) {
bounds.x = x;
bounds.y = y;
synchronized (getDelegateLock()) {
if (notify) {
if (resized) {
if (moved) {
synchronized (getStateLock()) {
synchronized (getStateLock()) {
synchronized (getStateLock()) {
background = c;
synchronized (getDelegateLock()) {
repaintPeer();
synchronized (getStateLock()) {
return background;
synchronized (getStateLock()) {
foreground = c;
synchronized (getDelegateLock()) {
repaintPeer();
synchronized (getStateLock()) {
return foreground;
synchronized (getStateLock()) {
font = f;
synchronized (getDelegateLock()) {
repaintPeer();
synchronized (getStateLock()) {
return font;
if (g != null) {
return g.getFontMetrics(f);
synchronized (getDelegateLock()) {
if (g != null) {
g.dispose();
public void setEnabled(final boolean e) {
boolean status = e;
synchronized (getStateLock()) {
synchronized (getDelegateLock()) {
repaintPeer();
public final boolean isEnabled() {
synchronized (getStateLock()) {
return enabled;
public void setVisible(boolean v) {
synchronized (getStateLock()) {
if (visible == v) {
visible = v;
synchronized (getDelegateLock()) {
if (visible) {
repaintPeer();
public final boolean isVisible() {
synchronized (getStateLock()) {
return visible;
public boolean isReparentSupported() {
if (!(e instanceof IgnorePaintEvent)) {
public void layout() {
public boolean isObscured() {
public boolean canDetermineObscurity() {
return getMinimumSize();
synchronized (getDelegateLock()) {
public void updateCursorImmediately() {
public boolean isFocusable() {
switch (result) {
public boolean handlesWheelScrolling() {
synchronized (getStateLock()) {
synchronized (getStateLock()) {
synchronized (dropTargetLock){
synchronized (dropTargetLock){
protected final void handleMove(final int x, final int y,
final boolean updateTarget) {
if (updateTarget) {
protected final void handleResize(final int w, final int h,
final boolean updateTarget) {
if (updateTarget) {
protected void postPaintEvent(int x, int y, int w, int h) {
switch (e.getID()) {
synchronized (getDelegateLock()) {
if (e instanceof MouseWheelEvent) {
} else if (e instanceof MouseEvent) {
} else if (e instanceof KeyEvent) {
} else if (e instanceof FocusEvent) {
return delegateEvent;
protected final boolean shouldClearRectBeforePaint() {
private void handleJavaPaintEvent() {
if (!isLayouting()) {
p.x -= cpb.x;
p.y -= cpb.y;
return new Point(p);
return new Point(p);
public final void repaintPeer() {
protected boolean isShowing() {
synchronized (getPeerTreeLock()) {
if (isVisible()) {
synchronized (getDelegateLock()) {
protected final void flushOffscreenGraphics() {
protected static final void flushOnscreenGraphics(){
null);
g.dispose();
private final boolean isLayouting() {
return isLayouting;