@Override protected void paintComponent(Graphics g) { super.paintComponent(g); // Hole gesamte Tabelle Vector<Vector<Integer>> data = TableContainer.getInstance().getListItems(); if (data != null) { // Umrandung g.setColor(Color.BLACK); g.drawRect(0, 0, this.xMaxScaled, this.yMaxScaled); g.setColor(Color.RED); for (int i = 1; i < data.size(); i++) { int x1, y1, x2, y2; try { x1 = data.get(i - 1).get(0) / Constants.GRAPH_SCALE_DIVISOR; y1 = data.get(i - 1).get(1) / Constants.GRAPH_SCALE_DIVISOR; x2 = data.get(i).get(0) / Constants.GRAPH_SCALE_DIVISOR; y2 = data.get(i).get(1) / Constants.GRAPH_SCALE_DIVISOR; } catch (Exception e) { System.out.println("Fehlerhafter Tabelleneintrag: " + e); return; } g.drawLine(x1, y1, x2, y2); } } }
public ActionContainer(TableContainer tableContainer) { this.table = tableContainer.getTable(); this.name = tableContainer.getTableContainerName(); clear(); }