Package org.zkoss.zss.ui

Examples of org.zkoss.zss.ui.Rect


  }
 
  protected ChartData fillXYData(XYData data, Rect selection) {
    final Worksheet sheet = _spreadsheet.getSelectedSheet();
   
    Rect rect = getChartDataRange(selection);
    int colIdx = rect.getLeft();
    int rowIdx = rect.getTop();
   
    ChartDataSource<Number> horValues = null;
    ArrayList<ChartTextSource> titles = new ArrayList<ChartTextSource>();
    ArrayList<ChartDataSource<Number>> values = new ArrayList<ChartDataSource<Number>>();
   
View Full Code Here


    return data;
  }
 
  protected CategoryData fillCategoryData(CategoryData data, Rect selection) {
    Worksheet sheet = _spreadsheet.getSelectedSheet();
    Rect rect = getChartDataRange(selection);
    int colIdx = rect.getLeft();
    int rowIdx = rect.getTop();
   
    ChartDataSource<String> cats = null;
    ArrayList<ChartTextSource> titles = new ArrayList<ChartTextSource>();
    ArrayList<ChartDataSource<Number>> vals = new ArrayList<ChartDataSource<Number>>();
   
View Full Code Here

  public KeyEvent(String name, Component target, int keyCode,
      boolean ctrlKey, boolean shiftKey, boolean altKey,
      int tRow, int lCol, int bRow, int rCol) {
    super(name, target, keyCode, ctrlKey, shiftKey, altKey);
   
    selection = new Rect(lCol, tRow, rCol, bRow);
  }
View Full Code Here

public class ActiveRangeHelper {

  private HashMap<Worksheet, Rect> activeRanges = new HashMap<Worksheet, Rect>();
 
  public void setActiveRange(Worksheet sheet, int tRow, int lCol, int bRow, int rCol) {
    Rect rect = activeRanges.get(sheet);
    if (rect == null) {
      activeRanges.put(sheet, rect = new Rect(lCol, tRow, rCol, bRow));
    } else {
      rect.set(lCol, tRow, rCol, bRow);
    }
  }
View Full Code Here

  public boolean contains(Worksheet sheet, int row, int col) {
    return contains(sheet, row, col, row, col);
  }
 
  public boolean contains(Worksheet sheet, int tRow, int lCol, int bRow, int rCol) {
    Rect rect = activeRanges.get(sheet);
    if (rect == null)
      return false;
    return rect.contains(tRow, lCol, bRow, rCol);
  }
View Full Code Here

    font = spreadsheet.getBook().getFontAt(idx);
  }
 
  public void setFontSize(int size) {
    Worksheet sheet = spreadsheet.getSelectedSheet();
    Rect rect = spreadsheet.getSelection();

    Utils.setFontHeight(sheet,
        rect,
        getFontHeight(size))
    setProperRowHeightByFontSize(sheet, rect, size);
View Full Code Here

    buildHeaderModel();
   
    columns.setModel(availableColumns);
    rows.setModel(availableRows);
   
    final Rect visibleRect = getWorkbookCtrl().getVisibleRect();
    columns.addEventListener("onAfterRender", new EventListener() {
     
      @Override
      public void onEvent(Event event) throws Exception {
        int width = ((visibleRect.getRight() - visibleRect.getLeft() + 1) / 4);
        columns.setSelectedIndex(visibleRect.getLeft() + width);
      }
    });
    rows.addEventListener("onAfterRender", new EventListener() {

      @Override
      public void onEvent(Event event) throws Exception {
        int height = ((visibleRect.getBottom() - visibleRect.getTop() + 1) / 4);
        rows.setSelectedIndex(visibleRect.getTop() + height);
      }
    });
  }
View Full Code Here

    arg.put(KEY_ARG_SPREADSGEET, spreadsheet);
    return arg;
  }
 
  public void onOpen$_customSortDialog(ForwardEvent event) {
    Rect selection = (Rect) event.getOrigin().getData();
    ss.setSelection(selection);
    init();
    _customSortDialog.setMode(Window.MODAL);
  }
View Full Code Here

  public void onOpen$insertWidgetAtDialog(ForwardEvent evt) {
    updateCenterColumnRow();
  }
 
  private void updateCenterColumnRow() {
    final Rect visibleRect = getWorkbookCtrl().getVisibleRect();
    int width = ((visibleRect.getRight() - visibleRect.getLeft() + 1) / 4);
    int col = visibleRect.getLeft() + width;
    if (col < columns.getChildren().size()) {
      columns.setSelectedIndex(visibleRect.getLeft() + width);
    }
    int height = ((visibleRect.getBottom() - visibleRect.getTop() + 1) / 4);
    int row = visibleRect.getTop() + height;
    if (row < rows.getChildren().size()) {
      rows.setSelectedIndex(visibleRect.getTop() + height);
    }
  }
View Full Code Here

   * <p> Sort target is row if sort direction is from left to right
   */
  private void setAvailableSortTarget (List<String> list) {
    list.clear();
    list.add(new String(""));
    Rect rect = ss.getSelection();
    if (sortOrientation == SORT_TOP_TO_BOTTOM) {
      for (int i = rect.getLeft(); i <= rect.getRight(); i++)
        list.add(new String("Column " + ss.getColumntitle(i)));
    } else {
      for (int i = rect.getTop(); i <= rect.getBottom(); i++)
        list.add(new String("Row " + ss.getRowtitle(i)));
    }
    sortIndexModel.clear();
    sortIndexModel.addAll(list);
  }
View Full Code Here

TOP

Related Classes of org.zkoss.zss.ui.Rect

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.