Renderer(JXLabel c, ViewFactory f, View v, boolean wordWrap) { super(null, wordWrap); factory = f; view = v; view.setParent(this); host = c; //log.fine("vir: " + host.getVisibleRect()); int w; if (host.getVisibleRect().width == 0) { invalidated = true; return; } else { w = host.getVisibleRect().width; } //log.fine("w:" + w); // initially layout to the preferred size //setSize(c.getMaxLineSpan() > -1 ? c.getMaxLineSpan() : view.getPreferredSpan(X_AXIS), view.getPreferredSpan(Y_AXIS)); setSize(c.getMaxLineSpan() > -1 ? c.getMaxLineSpan() : w, host.getVisibleRect().height); }
Renderer(JXLabel c, ViewFactory f, View v, boolean wordWrap) { super(null, wordWrap); factory = f; view = v; view.setParent(this); host = c; //log.fine("vir: " + host.getVisibleRect()); int w; if (host.getVisibleRect().width == 0) { invalidated = true; return; } else { w = host.getVisibleRect().width; } //log.fine("w:" + w); // initially layout to the preferred size //setSize(c.getMaxLineSpan() > -1 ? c.getMaxLineSpan() : view.getPreferredSpan(X_AXIS), view.getPreferredSpan(Y_AXIS)); setSize(c.getMaxLineSpan() > -1 ? c.getMaxLineSpan() : w, host.getVisibleRect().height); }
Renderer(JXLabel c, ViewFactory f, View v, boolean wordWrap) { super(null, wordWrap); factory = f; view = v; view.setParent(this); host = c; //log.fine("vir: " + host.getVisibleRect()); int w; if (host.getVisibleRect().width == 0) { invalidated = true; return; } else { w = host.getVisibleRect().width; } //log.fine("w:" + w); // initially layout to the preferred size //setSize(c.getMaxLineSpan() > -1 ? c.getMaxLineSpan() : view.getPreferredSpan(X_AXIS), view.getPreferredSpan(Y_AXIS)); setSize(c.getMaxLineSpan() > -1 ? c.getMaxLineSpan() : w, host.getVisibleRect().height); }
Renderer(JXLabel c, ViewFactory f, View v, boolean wordWrap) { super(null, wordWrap); factory = f; view = v; view.setParent(this); host = c; //log.fine("vir: " + host.getVisibleRect()); int w; if (host.getVisibleRect().width == 0) { invalidated = true; return; } else { w = host.getVisibleRect().width; } //log.fine("w:" + w); // initially layout to the preferred size //setSize(c.getMaxLineSpan() > -1 ? c.getMaxLineSpan() : view.getPreferredSpan(X_AXIS), view.getPreferredSpan(Y_AXIS)); setSize(c.getMaxLineSpan() > -1 ? c.getMaxLineSpan() : w, host.getVisibleRect().height); }
Renderer(JXLabel c, ViewFactory f, View v, boolean wordWrap) { super(null, wordWrap); factory = f; view = v; view.setParent(this); host = c; //log.fine("vir: " + host.getVisibleRect()); int w; if (host.getVisibleRect().width == 0) { invalidated = true; return; } else { w = host.getVisibleRect().width; } //log.fine("w:" + w); // initially layout to the preferred size //setSize(c.getMaxLineSpan() > -1 ? c.getMaxLineSpan() : view.getPreferredSpan(X_AXIS), view.getPreferredSpan(Y_AXIS)); setSize(c.getMaxLineSpan() > -1 ? c.getMaxLineSpan() : w, host.getVisibleRect().height); }
@Override public float getPreferredSpan(int axis) { if (axis == X_AXIS) { //log.fine("inv: " + invalidated + ", w:" + width + ", vw:" + host.getVisibleRect()); // width currently laid out to if (invalidated) { int w = host.getVisibleRect().width; if (w != 0) { //log.fine("vrh: " + host.getVisibleRect().height); invalidated = false; // JXLabelTest4 works setSize(w - (host.getOccupiedWidth()), host.getVisibleRect().height); // JXLabelTest3 works; 20 == width of the parent border!!! ... why should this screw with us? //setSize(w - (host.getOccupiedWidth()+20), host.getVisibleRect().height); } } return width > 0 ? width : view.getPreferredSpan(axis); } else { return view.getPreferredSpan(axis); } }
@Override public float getPreferredSpan(int axis) { if (axis == X_AXIS) { //log.fine("inv: " + invalidated + ", w:" + width + ", vw:" + host.getVisibleRect()); // width currently laid out to if (invalidated) { int w = host.getVisibleRect().width; if (w != 0) { //log.fine("vrh: " + host.getVisibleRect().height); invalidated = false; // JXLabelTest4 works setSize(w - (host.getOccupiedWidth()), host.getVisibleRect().height); // JXLabelTest3 works; 20 == width of the parent border!!! ... why should this screw with us? //setSize(w - (host.getOccupiedWidth()+20), host.getVisibleRect().height); } } return width > 0 ? width : view.getPreferredSpan(axis); } else { return view.getPreferredSpan(axis); } }
@Override public float getPreferredSpan(int axis) { if (axis == X_AXIS) { //log.fine("inv: " + invalidated + ", w:" + width + ", vw:" + host.getVisibleRect()); // width currently laid out to if (invalidated) { int w = host.getVisibleRect().width; if (w != 0) { //log.fine("vrh: " + host.getVisibleRect().height); invalidated = false; // JXLabelTest4 works setSize(w - (host.getOccupiedWidth()), host.getVisibleRect().height); // JXLabelTest3 works; 20 == width of the parent border!!! ... why should this screw with us? //setSize(w - (host.getOccupiedWidth()+20), host.getVisibleRect().height); } } return width > 0 ? width : view.getPreferredSpan(axis); } else { return view.getPreferredSpan(axis); } }
@Override public float getPreferredSpan(int axis) { if (axis == X_AXIS) { //log.fine("inv: " + invalidated + ", w:" + width + ", vw:" + host.getVisibleRect()); // width currently laid out to if (invalidated) { int w = host.getVisibleRect().width; if (w != 0) { //log.fine("vrh: " + host.getVisibleRect().height); invalidated = false; // JXLabelTest4 works setSize(w - (host.getOccupiedWidth()), host.getVisibleRect().height); // JXLabelTest3 works; 20 == width of the parent border!!! ... why should this screw with us? //setSize(w - (host.getOccupiedWidth()+20), host.getVisibleRect().height); } } return width > 0 ? width : view.getPreferredSpan(axis); } else { return view.getPreferredSpan(axis); } }
@Override public float getPreferredSpan(int axis) { if (axis == X_AXIS) { //log.fine("inv: " + invalidated + ", w:" + width + ", vw:" + host.getVisibleRect()); // width currently laid out to if (invalidated) { int w = host.getVisibleRect().width; if (w != 0) { //log.fine("vrh: " + host.getVisibleRect().height); invalidated = false; // JXLabelTest4 works setSize(w - (host.getOccupiedWidth()), host.getVisibleRect().height); // JXLabelTest3 works; 20 == width of the parent border!!! ... why should this screw with us? //setSize(w - (host.getOccupiedWidth()+20), host.getVisibleRect().height); } } return width > 0 ? width : view.getPreferredSpan(axis); } else { return view.getPreferredSpan(axis); } }
@Override @SuppressWarnings("deprecation") public void reshape(int x, int y, int w, int h) { int oldH = getHeight(); super.reshape(x, y, w, h); if (!isLineWrap()) { return; } if (oldH == 0) { return; } if (w > getVisibleRect().width) { w = getVisibleRect().width; } View view = (View) getClientProperty(BasicHTML.propertyKey); if (view != null && view instanceof Renderer) { view.setSize(w - occupiedWidth, h); } }
@Override public void reshape(int x, int y, int w, int h) { int oldH = getHeight(); super.reshape(x, y, w, h); if (!isLineWrap()) { return; } if (oldH == 0) { return; } if (w > getVisibleRect().width) { w = getVisibleRect().width; } View view = (View) getClientProperty(BasicHTML.propertyKey); if (view != null && view instanceof Renderer) { view.setSize(w - occupiedWidth, h); } }
@Override @SuppressWarnings("deprecation") public void reshape(int x, int y, int w, int h) { int oldH = getHeight(); super.reshape(x, y, w, h); if (!isLineWrap()) { return; } if (oldH == 0) { return; } if (w > getVisibleRect().width) { w = getVisibleRect().width; } View view = (View) getClientProperty(BasicHTML.propertyKey); if (view != null && view instanceof Renderer) { view.setSize(w - occupiedWidth, h); } }
@Override @SuppressWarnings("deprecation") public void reshape(int x, int y, int w, int h) { int oldH = getHeight(); super.reshape(x, y, w, h); if (!isLineWrap()) { return; } if (oldH == 0) { return; } if (w > getVisibleRect().width) { w = getVisibleRect().width; } View view = (View) getClientProperty(BasicHTML.propertyKey); if (view != null && view instanceof Renderer) { view.setSize(w - occupiedWidth, h); } }
@Override @SuppressWarnings("deprecation") public void reshape(int x, int y, int w, int h) { int oldH = getHeight(); super.reshape(x, y, w, h); if (!isLineWrap()) { return; } if (oldH == 0) { return; } if (w > getVisibleRect().width) { w = getVisibleRect().width; } View view = (View) getClientProperty(BasicHTML.propertyKey); if (view != null && view instanceof Renderer) { view.setSize(w - occupiedWidth, h); } }