public int getItemCount() { return (int) matrix.getRowCount(); }
public int getItemCount() { return (int) matrix.getRowCount(); }
public int getRowCount() { return model.getRowCount(); }
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(); } } }
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 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; } }
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); } }
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); }
long totalRows = matrixGUIObject.getRowCount(); final long rowCount = matrixGUIObject.getRowCount(); final long colCount = matrixGUIObject.getColumnCount(); for (int row = 0; row < rowCount; row++) { - PADDINGY, null); if (width > 20 && matrixGUIObject.getRowCount() == 1 && matrixGUIObject.getColumnCount() == 1) { final Color col = matrixGUIObject.getColorAt(0, 0); g2d.setColor(ColorUtil.contrastBW(col));
if (m.getRowCount() > 1) { try { Class.forName("org.math.plot.PlotPanel"); if (m.getRowCount() > 1 && m.getColumnCount() > 1) { try { Class.forName("org.math.plot.PlotPanel"); if (m.getRowCount() > 1 && m.getColumnCount() > 1) { try { Class.forName("org.math.plot.PlotPanel"); if (m.getRowCount() > 1 && m.getColumnCount() > 1) { try { Class.forName("org.math.plot.PlotPanel"); if (m.getRowCount() > 1 && m.getColumnCount() > 1) { try { Class.forName("org.math.plot.PlotPanel"); if (m.getRowCount() > 1 && m.getColumnCount() > 1) { try { Class.forName("org.math.plot.PlotPanel"); if (m.getRowCount() > 1 && m.getColumnCount() > 1) { try { Class.forName("org.math.plot.PlotPanel");
double yf = plotSettings.getYFactor(); if (plotSettings.getMatrixGUIObject().getRowCount() < 2) { return;
plotSettings.setWidth(getWidth()); plotSettings.setMinXValue(0.0); plotSettings.setMaxXValue(guiObject.getRowCount() - 1); plotSettings.setMinYValue(-1); plotSettings.setMaxYValue(100);
dataModel.getColumnSelectionModel().addListSelectionListener(this); if (dataModel.getRowCount() < 0 || dataModel.getColumnCount() < 0) { isShowPreloader = true;