/** * Format the table and apply the specified Line to all cell boundaries, * both outside and inside. * An empty args parameter removes the affected border. * * @param args a varargs array possible containing {@link Double} (width), * {@link LineCompound}, {@link Color}, {@link LineDash} */ public void setAllBorders(Object... args) { TableShape<?,?> table = getShape(); final int rows = table.getNumberOfRows(); final int cols = table.getNumberOfColumns(); BorderEdge edges[] = { BorderEdge.top, BorderEdge.left, null, null }; for (int row = 0; row < rows; row++) { for (int col = 0; col < cols; col++) { edges[2] = (col == cols - 1) ? BorderEdge.right : null; edges[3] = (row == rows - 1) ? BorderEdge.bottom : null; setEdges(table.getCell(row, col), edges, args); } } }
/** * Format the inside border using the specified Line object * An empty args parameter removes the affected border. * * @param args a varargs array possible containing {@link Double} (width), * {@link LineCompound}, {@link Color}, {@link LineDash} */ public void setInsideBorders(Object... args) { if (args.length == 0) return; TableShape<?,?> table = getShape(); final int rows = table.getNumberOfRows(); final int cols = table.getNumberOfColumns(); BorderEdge edges[] = new BorderEdge[2]; for (int row = 0; row < rows; row++) { for (int col = 0; col < cols; col++) { edges[0] = (col > 0 && col < cols - 1) ? BorderEdge.right : null; edges[1] = (row > 0 && row < rows - 1) ? BorderEdge.bottom : null; setEdges(table.getCell(row, col), edges, args); } } }
/** * Format the outside border using the specified Line object * An empty args parameter removes the affected border. * * @param args a varargs array possible containing {@link Double} (width), * {@link LineCompound}, {@link Color}, {@link LineDash} */ public void setOutsideBorders(Object... args){ if (args.length == 0) return; TableShape<?,?> table = getShape(); final int rows = table.getNumberOfRows(); final int cols = table.getNumberOfColumns(); BorderEdge edges[] = new BorderEdge[4]; for (int row = 0; row < rows; row++) { for (int col = 0; col < cols; col++) { edges[0] = (col == 0) ? BorderEdge.left : null; edges[1] = (col == cols - 1) ? BorderEdge.right : null; edges[2] = (row == 0) ? BorderEdge.top : null; edges[3] = (row == rows - 1) ? BorderEdge.bottom : null; setEdges(table.getCell(row, col), edges, args); } } }
TableShape<?,?> ts = getShape(); DrawPaint drawPaint = DrawFactory.getInstance(graphics).getPaint(ts); final int rows = ts.getNumberOfRows();
public void drawContent(Graphics2D graphics) { Drawable d = getGroupShape(graphics); if (d != null) { d.drawContent(graphics); return; } TableShape<?,?> ts = getShape(); DrawFactory df = DrawFactory.getInstance(graphics); final int rows = ts.getNumberOfRows(); final int cols = ts.getNumberOfColumns(); for (int row=0; row<rows; row++) { for (int col=0; col<cols; col++) { TableCell<?,?> tc = ts.getCell(row, col); if (tc != null) { DrawTextShape dts = df.getDrawable(tc); dts.drawContent(graphics); } } } }
/** * Format the inside border using the specified Line object * An empty args parameter removes the affected border. * * @param args a varargs array possible containing {@link Double} (width), * {@link LineCompound}, {@link Color}, {@link LineDash} */ public void setInsideBorders(Object... args) { if (args.length == 0) return; TableShape<?,?> table = getShape(); final int rows = table.getNumberOfRows(); final int cols = table.getNumberOfColumns(); BorderEdge edges[] = new BorderEdge[2]; for (int row = 0; row < rows; row++) { for (int col = 0; col < cols; col++) { edges[0] = (col > 0 && col < cols - 1) ? BorderEdge.right : null; edges[1] = (row > 0 && row < rows - 1) ? BorderEdge.bottom : null; setEdges(table.getCell(row, col), edges, args); } } }
/** * Format the outside border using the specified Line object * An empty args parameter removes the affected border. * * @param args a varargs array possible containing {@link Double} (width), * {@link LineCompound}, {@link Color}, {@link LineDash} */ public void setOutsideBorders(Object... args){ if (args.length == 0) return; TableShape<?,?> table = getShape(); final int rows = table.getNumberOfRows(); final int cols = table.getNumberOfColumns(); BorderEdge edges[] = new BorderEdge[4]; for (int row = 0; row < rows; row++) { for (int col = 0; col < cols; col++) { edges[0] = (col == 0) ? BorderEdge.left : null; edges[1] = (col == cols - 1) ? BorderEdge.right : null; edges[2] = (row == 0) ? BorderEdge.top : null; edges[3] = (row == rows - 1) ? BorderEdge.bottom : null; setEdges(table.getCell(row, col), edges, args); } } }
/** * Format the table and apply the specified Line to all cell boundaries, * both outside and inside. * An empty args parameter removes the affected border. * * @param args a varargs array possible containing {@link Double} (width), * {@link LineCompound}, {@link Color}, {@link LineDash} */ public void setAllBorders(Object... args) { TableShape<?,?> table = getShape(); final int rows = table.getNumberOfRows(); final int cols = table.getNumberOfColumns(); BorderEdge edges[] = { BorderEdge.top, BorderEdge.left, null, null }; for (int row = 0; row < rows; row++) { for (int col = 0; col < cols; col++) { edges[2] = (col == cols - 1) ? BorderEdge.right : null; edges[3] = (row == rows - 1) ? BorderEdge.bottom : null; setEdges(table.getCell(row, col), edges, args); } } }
TableShape<?,?> ts = getShape(); DrawPaint drawPaint = DrawFactory.getInstance(graphics).getPaint(ts); final int rows = ts.getNumberOfRows();
public void drawContent(Graphics2D graphics) { Drawable d = getGroupShape(graphics); if (d != null) { d.drawContent(graphics); return; } TableShape<?,?> ts = getShape(); DrawFactory df = DrawFactory.getInstance(graphics); final int rows = ts.getNumberOfRows(); final int cols = ts.getNumberOfColumns(); for (int row=0; row<rows; row++) { for (int col=0; col<cols; col++) { TableCell<?,?> tc = ts.getCell(row, col); if (tc != null) { DrawTextShape dts = df.getDrawable(tc); dts.drawContent(graphics); } } } }