/** * Gets the tile with specified row and column indices. * @param irow the row index. * @param icol the column index. * @return the tile. */ public Tile getTile(int irow, int icol) { return _mosaic.getTile(irow,icol); }
/** * Constructs a new color bar with specified label. * @param label the label; null, if none. */ public ColorBar(String label) { super(); _mosaic = new Mosaic(1,1,EnumSet.of(Mosaic.AxesPlacement.RIGHT)); if (label!=null) _mosaic.getTileAxisRight(0).setLabel(label); _mosaic.setWidthMinimum(0,15); _mosaic.setWidthElastic(0,0); _tile = _mosaic.getTile(0,0); this.setLayout(new BorderLayout()); this.add(_mosaic,BorderLayout.CENTER); }
for (int irow=0; irow<nrow; ++irow) { for (int icol=0; icol<ncol; ++icol) { mosaic.getTile(irow,icol).addTiledView(new PointsView(x1,x2));
/** * Gets the tile adjacent to this axis. * @return the tile. */ public Tile getTile() { if (isTop()) { return _mosaic.getTile(0,_index); } else if (isLeft()) { return _mosaic.getTile(_index,0); } else if (isBottom()) { int irow = _mosaic.countRows()-1; return _mosaic.getTile(irow,_index); } else if (isRight()) { int icol = _mosaic.countColumns()-1; return _mosaic.getTile(_index,icol); } else { return null; } }
int nrow = mosaic.countRows(); for (int irow=0; irow<nrow; ++irow) drawZoom(mosaic.getTile(irow,jcol),x,y,true,false); if (axis.isTop()) { drawZoom(mosaic.getTileAxisBottom(jcol),x,y,true,false); int ncol = mosaic.countColumns(); for (int icol=0; icol<ncol; ++icol) drawZoom(mosaic.getTile(jrow,icol),x,y,false,true); if (axis.isLeft()) { drawZoom(mosaic.getTileAxisRight(jrow),x,y,false,true);
private void showLines() { Mosaic mosaic = getMosaic(); Tile t00 = mosaic.getTile(0,0); Tile t10 = mosaic.getTile(1,0); Tile t11 = mosaic.getTile(1,1); if (_orientation==Orientation.X1DOWN_X2RIGHT) { t00.addTiledView(_l23); t10.addTiledView(_l12); t11.addTiledView(_l13); } else if (_orientation==Orientation.X1DOWN_X3RIGHT) { t00.addTiledView(_l23); t10.addTiledView(_l13); t11.addTiledView(_l12); } else if (_orientation==Orientation.X1RIGHT_X2UP) { t00.addTiledView(_l13); t10.addTiledView(_l12); t11.addTiledView(_l23); } else if (_orientation==Orientation.X1RIGHT_X3UP) { t00.addTiledView(_l12); t10.addTiledView(_l13); t11.addTiledView(_l23); } } private void hideLines() {
private void hideLines() { Mosaic mosaic = getMosaic(); Tile t00 = mosaic.getTile(0,0); Tile t10 = mosaic.getTile(1,0); Tile t11 = mosaic.getTile(1,1); if (_orientation==Orientation.X1DOWN_X2RIGHT) { t00.removeTiledView(_l23); t10.removeTiledView(_l12); t11.removeTiledView(_l13); } else if (_orientation==Orientation.X1DOWN_X3RIGHT) { t00.removeTiledView(_l23); t10.removeTiledView(_l13); t11.removeTiledView(_l12); } else if (_orientation==Orientation.X1RIGHT_X2UP) { t00.removeTiledView(_l13); t10.removeTiledView(_l12); t11.removeTiledView(_l23); } else if (_orientation==Orientation.X1RIGHT_X3UP) { t00.removeTiledView(_l12); t10.removeTiledView(_l13); t11.removeTiledView(_l23); } }
private static void plot(TriMesh tm) { TriMeshView tmv = new TriMeshView(tm); tmv.setPolysVisible(true); tmv.setTriColor(Color.BLACK); tmv.setPolyColor(Color.BLUE); PlotPanel panel = new PlotPanel(); panel.setHLabel("x"); panel.setVLabel("y"); Mosaic mosaic = panel.getMosaic(); mosaic.getTile(0,0).addTiledView(tmv); PlotFrame frame = new PlotFrame(panel); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setSize(700,700); frame.setVisible(true); } }