コード例 #1
0
  public GridImpl(ViewContextEx viewContext, String sessionName) {
    myViewContext = viewContext;
    mySessionName = sessionName;

    Disposer.register(myViewContext, this);
    Disposer.register(this, myTopSplit);

    Placeholder left = new Placeholder();
    myPlaceInGrid2Cell.put(
        PlaceInGrid.left, new GridCellImpl(myViewContext, this, left, PlaceInGrid.left));
    Placeholder center = new Placeholder();
    myPlaceInGrid2Cell.put(
        PlaceInGrid.center, new GridCellImpl(myViewContext, this, center, PlaceInGrid.center));
    Placeholder right = new Placeholder();
    myPlaceInGrid2Cell.put(
        PlaceInGrid.right, new GridCellImpl(myViewContext, this, right, PlaceInGrid.right));
    Placeholder bottom = new Placeholder();
    myPlaceInGrid2Cell.put(
        PlaceInGrid.bottom, new GridCellImpl(myViewContext, this, bottom, PlaceInGrid.bottom));

    setContent(mySplitter);
    setOpaque(false);
    setFocusCycleRoot(true);

    myTopSplit.setFirstComponent(left);
    myTopSplit.setInnerComponent(center);
    myTopSplit.setLastComponent(right);
    myTopSplit.setMinSize(48);
    mySplitter.setFirstComponent(myTopSplit);
    mySplitter.setSecondComponent(bottom);
  }
コード例 #2
0
  float getRightProportion() {
    final float totalSize =
        myTopSplit.getOrientation() ? myTopSplit.getHeight() : myTopSplit.getWidth();
    final float componentSize = myTopSplit.getLastSize();

    return componentSize / (totalSize - 2.0f * myTopSplit.getDividerWidth());
  }
コード例 #3
0
 void setRightProportion(float proportion) {
   final int componentSize =
       myTopSplit.getOrientation() ? myTopSplit.getHeight() : myTopSplit.getWidth();
   myTopSplit.setLastSize(
       (int) (proportion * (float) (componentSize - 2 * myTopSplit.getDividerWidth())));
 }
コード例 #4
0
 void setLeftProportion(float proportion) {
   final int totalSize =
       myTopSplit.getOrientation() ? myTopSplit.getHeight() : myTopSplit.getWidth();
   myTopSplit.setFirstSize(
       (int) (proportion * (float) (totalSize - 2 * myTopSplit.getDividerWidth())));
 }