public XYSeriesCollectionWrapper(MatrixGUIObject m) { this.matrix = m; int size = (int) Math.min(m.getColumnCount(), maxSeriesCount); for (int i = 0; i < size; i++) { addSeries(new XYSeriesWrapper(matrix, i)); } }
public XYSeriesCollectionWrapper(MatrixGUIObject m) { this.matrix = m; int size = (int) Math.min(m.getColumnCount(), maxSeriesCount); for (int i = 0; i < size; i++) { addSeries(new XYSeriesWrapper(matrix, i)); } }
public String getToolTipText(MouseEvent e) { // only generate tool text when a matrix with size >0 is available if (matrixGUIObject.getRowCount() > 0 && matrixGUIObject.getColumnCount() > 0) { long r = getRowPos(e.getY()); long c = getColPos(e.getX()); r = r < 0 ? 0 : r; c = c < 0 ? 0 : c; r = r >= matrixGUIObject.getRowCount() ? matrixGUIObject.getRowCount() - 1 : r; c = c >= matrixGUIObject.getColumnCount() ? matrixGUIObject.getColumnCount() - 1 : c; String toolTip = TooltipUtil.getTooltip(matrixGUIObject, r, c); return toolTip; } else { return null; } }
public void mouseClicked(MouseEvent e) { long newRow = getRowPos(e.getY()); long newCol = getColPos(e.getX()); if (e.getButton() == MouseEvent.BUTTON3) { newRow = newRow < 0 ? 0 : newRow; newCol = newCol < 0 ? 0 : newCol; newRow = newRow >= matrixGUIObject.getRowCount() ? matrixGUIObject.getRowCount() - 1 : newRow; newCol = newCol >= matrixGUIObject.getColumnCount() ? matrixGUIObject.getColumnCount() - 1 : newCol; JPopupMenu popup = new MatrixPopupMenu(this, matrixGUIObject, newRow, newCol); popup.show(this, e.getX(), e.getY()); } else if (e.getButton() == MouseEvent.BUTTON1) { // left click: show new window if value is a matrix Object o = matrixGUIObject.getValueAt(newRow, newCol); if (o instanceof Matrix) { ((Matrix) o).showGUI(); } } }
public void paint(Graphics g) { Graphics2D g2d = (Graphics2D) g; g2d.addRenderingHints(UIDefaults.AALIAS); MatrixGUIObject m = (MatrixGUIObject) getGUIObject(); final int totalCount = m.getColumnCount(); Color color = new Color(0, 0, 200, 128); final int size = getCircleSize(totalCount); final int xCount = getSize().width / size; for (int index = 0; index < totalCount; index++) { g2d.setColor(color); g2d.fillOval(size * (index % xCount), size * (index / xCount), size / 2, size / 2); } for (long[] c : m.getMatrix().availableCoordinates()) { g2d.setColor(color); g2d.drawLine((int) (size * (c[0] % xCount)), (int) (size * (c[0] / xCount)), (int) (size * (c[1] % xCount)), (int) (size * (c[1] / xCount))); } }
private static boolean paintMatrixOriginal(Graphics g, MatrixGUIObject matrix, int width, int height) { boolean wasAllDataLoaded = true; try { long cols = matrix.getColumnCount(); long rows = matrix.getRowCount(); if (width > 20 && matrix.getRowCount() == 1 && matrix.getColumnCount() == 1) { String s = UJMPFormat.getSingleLineInstance().format(matrix.getValueAt(0, 0)); if (s != null && s.length() > 25) {
private void removePreloader() { if (isShowPreloader && dataModel.getRowCount() >= 0 && dataModel.getColumnCount() >= 0) { isShowPreloader = false; this.remove(preloader); this.add(scrollPane, BorderLayout.CENTER); this.revalidate(); } }
public int getDimension() { int dimension = -1; if (dimension == -1) { if (getMatrixObject().getColumnCount() == 1) { dimension = ROW; } else if (getMatrixObject().getRowCount() == 1) { dimension = COLUMN; } } if (dimension == -1) { int i = JOptionPane.showOptionDialog(getComponent(), "Dimension", "Select Dimension", JOptionPane.OK_OPTION, JOptionPane.QUESTION_MESSAGE, null, new String[] { "Row", "Column", "All" }, "Row"); if (i == 2) { dimension = ALL; } else { dimension = i; } } return dimension; }
public void mouseDragged(MouseEvent e) { if (matrixGUIObject.getRowSelectionModel().getValueIsAdjusting()) { long newRow = getRowPos(e.getY()); long newCol = getColPos(e.getX()); newRow = newRow < 0 ? 0 : newRow; newCol = newCol < 0 ? 0 : newCol; newRow = newRow >= matrixGUIObject.getRowCount() ? matrixGUIObject.getRowCount() - 1 : newRow; newCol = newCol >= matrixGUIObject.getColumnCount() ? matrixGUIObject.getColumnCount() - 1 : newCol; matrixGUIObject.getRowSelectionModel().setSelectionInterval(startRow, newRow); matrixGUIObject.getColumnSelectionModel().setSelectionInterval(startCol, newCol); repaint(100); } }
protected void paintComponent(Graphics g) { if (bufferedImage == null) { super.paintComponent(g); } else { if (isPreloaderVisible) { remove(preloader); isPreloaderVisible = false; } Graphics2D g2d = (Graphics2D) g; g2d.drawImage(bufferedImage, 0, 0, getWidth(), getHeight(), null); if (!matrixGUIObject.getRowSelectionModel().isSelectionEmpty()) { int paddingX = UIManager.getInt("Table.paddingX"); int paddingY = UIManager.getInt("Table.paddingY"); g2d.setColor(Color.BLUE); g2d.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_ATOP, 0.3f)); long x1 = matrixGUIObject.getColumnSelectionModel().getMinSelectionIndex64(); long x2 = matrixGUIObject.getColumnSelectionModel().getMaxSelectionIndex64(); long y1 = matrixGUIObject.getRowSelectionModel().getMinSelectionIndex64(); long y2 = matrixGUIObject.getRowSelectionModel().getMaxSelectionIndex64(); double scaleX = (double) (getWidth() - paddingX - paddingX) / (double) matrixGUIObject.getColumnCount(); double scaleY = (double) (getHeight() - paddingY - paddingY) / (double) matrixGUIObject.getRowCount(); g2d.setStroke(new BasicStroke(2.0f)); g2d.drawRect((int) Math.floor(paddingX + x1 * scaleX), (int) Math.floor(paddingY + y1 * scaleY), (int) Math.ceil(scaleX + (x2 - x1) * scaleX), (int) Math.ceil(scaleY + (y2 - y1) * scaleY)); g2d.fillRect((int) Math.floor(paddingX + x1 * scaleX), (int) Math.floor(paddingY + y1 * scaleY), (int) Math.ceil(scaleX + (x2 - x1) * scaleX), (int) Math.ceil(scaleY + (y2 - y1) * scaleY)); } } }
public void mouseReleased(MouseEvent e) { if (e.getButton() == MouseEvent.BUTTON1) { long newRow = getRowPos(e.getY()); long newCol = getColPos(e.getX()); newRow = newRow < 0 ? 0 : newRow; newCol = newCol < 0 ? 0 : newCol; newRow = newRow >= matrixGUIObject.getRowCount() ? matrixGUIObject.getRowCount() - 1 : newRow; newCol = newCol >= matrixGUIObject.getColumnCount() ? matrixGUIObject.getColumnCount() - 1 : newCol; matrixGUIObject.getRowSelectionModel().setValueIsAdjusting(false); matrixGUIObject.getColumnSelectionModel().setValueIsAdjusting(false); matrixGUIObject.getRowSelectionModel().setSelectionInterval(startRow, newRow); matrixGUIObject.getColumnSelectionModel().setSelectionInterval(startCol, newCol); repaint(100); } }
public void repaintUI() { if (getWidth() > 0 && getHeight() > 0 && matrixGUIObject.getRowCount() >= 0 && matrixGUIObject.getColumnCount() >= 0) { BufferedImage tempBufferedImage = new BufferedImage(getWidth(), getHeight(), BufferedImage.TYPE_INT_RGB); renderer.setSize(getWidth(), getHeight()); renderer.setMatrix(matrixGUIObject); Graphics2D g2d = (Graphics2D) tempBufferedImage.getGraphics(); renderer.paintComponent(g2d); g2d.dispose(); bufferedImage = tempBufferedImage; } }
hasFocus, row, column); case MatrixListTableModel.SIZECOLUMN: o = "" + matrix.getColumnCount() + "x" + matrix.getRowCount(); break; case MatrixListTableModel.LABELCOLUMN:
public void mousePressed(MouseEvent e) { if (e.getButton() == MouseEvent.BUTTON1) { requestFocus(); startRow = getRowPos(e.getY()); startCol = getColPos(e.getX()); startRow = startRow < 0 ? 0 : startRow; startCol = startCol < 0 ? 0 : startCol; startRow = startRow >= matrixGUIObject.getRowCount() ? matrixGUIObject.getRowCount() - 1 : startRow; startCol = startCol >= matrixGUIObject.getColumnCount() ? matrixGUIObject.getColumnCount() - 1 : startCol; matrixGUIObject.getRowSelectionModel().setValueIsAdjusting(true); matrixGUIObject.getColumnSelectionModel().setValueIsAdjusting(true); matrixGUIObject.getRowSelectionModel().setSelectionInterval(startRow, startRow); matrixGUIObject.getColumnSelectionModel().setSelectionInterval(startCol, startCol); } repaint(100); }
public Object call() { Matrix result = getMatrixObject().getMatrix().sortrows(getNewOrLink(), GUIUtil.getInt("Column used for sorting", 0, (int) getMatrixObject().getColumnCount() - 1), GUIUtil.getBoolean("reverse order?")); return result; } }
double yf = plotSettings.getYFactor(); for (int t = 0; t < Math.min(10, plotSettings.getMatrixGUIObject().getColumnCount()); t++) {
for (int t = 0; t < Math.min(10, plotSettings.getMatrixGUIObject().getColumnCount()); t++) {
dataModel.getColumnSelectionModel().addListSelectionListener(this); if (dataModel.getRowCount() < 0 || dataModel.getColumnCount() < 0) { isShowPreloader = true;
for (int i = 0; i < getMatrix().getColumnCount(); i++) { renderer.setSeriesStroke(i, new BasicStroke(3)); plot.setRenderer(i, renderer);
for (int i = 0; i < getMatrix().getColumnCount(); i++) { renderer.setSeriesStroke(i, new BasicStroke(3)); plot.setRenderer(i, renderer);