Ejemplo n.º 1
0
    @Override
    public void layoutContainer(Container parent) {
      if (linkedViewPort == null) {
        super.layoutContainer(parent);
      } else {
        JViewport vp = (JViewport) parent;
        Component view = vp.getView();

        if (view != null) {
          Point p = linkedViewPort.getViewPosition();
          Dimension size = linkedViewPort.getViewSize();

          if (horizontalLink) {
            p.y = 0;
            size.height = vp.getExtentSize().height;
          } else {
            p.x = 0;
            size.width = vp.getExtentSize().width;
          }

          vp.setViewPosition(p);
          vp.setViewSize(size);
        }
      }
    }
Ejemplo n.º 2
0
 @Override
 public void addLayoutComponent(String name, Component c) {
   ((JComponent) c).putClientProperty(iPlatformComponent.RARE_SWING_WIDTH_FIXED_VALUE, null);
   ((JComponent) c).putClientProperty(iPlatformComponent.RARE_SWING_HEIGHT_FIXED_VALUE, null);
   super.addLayoutComponent(name, c);
 }
Ejemplo n.º 3
0
 @Override
 public void removeLayoutComponent(Component c) {
   ((JComponent) c).putClientProperty(iPlatformComponent.RARE_SWING_WIDTH_FIXED_VALUE, null);
   ((JComponent) c).putClientProperty(iPlatformComponent.RARE_SWING_HEIGHT_FIXED_VALUE, null);
   super.removeLayoutComponent(c);
 }