List of usage examples for org.jfree.chart ChartFrame setLocation
@Override public void setLocation(Point p)
The method changes the geometry-related data.
From source file:org.audiveris.omr.util.ChartPlotter.java
/** * Wrap chart into a frame with specific title and display the frame at provided * location.//from w w w.j av a 2s . c o m * * @param title frame title * @param location frame location */ public void display(String title, Point location) { ChartFrame frame = new ChartFrame(title, chart, true); frame.pack(); frame.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); frame.setLocation(location); frame.setVisible(true); }
From source file:User.Interface.SupplierAdminRole.ReviewSalesJPanel.java
private void displayBarCharts() { //check if the supplier has products in the product list if (supplierAdminOrganization.getMedicalDeviceCatalog().getMedicalDeviceList().size() < 0) { JOptionPane.showMessageDialog(this, "No products found from selected supplier.", "Warning", JOptionPane.WARNING_MESSAGE); return;/* w w w . j a v a2s .c om*/ } MedicalDevice[] product; product = new MedicalDevice[100]; int numberOfProducts = supplierAdminOrganization.getMedicalDeviceCatalog().getMedicalDeviceList().size(); DefaultCategoryDataset dataSetProduct = new DefaultCategoryDataset(); for (int i = 0; i < numberOfProducts; i++) { product[i] = supplierAdminOrganization.getMedicalDeviceCatalog().getMedicalDeviceList().get(i); int soldQuantity = 0; soldQuantity = product[i].getSoldQuantity(); String prodName = product[i].getDeviceName(); dataSetProduct.setValue(soldQuantity, "Medical Device", prodName); } JFreeChart chartProduct = ChartFactory.createBarChart("Supplier Performance Report", "Products", "Number of Products Sold", dataSetProduct, PlotOrientation.VERTICAL, false, true, false); CategoryPlot p1 = chartProduct.getCategoryPlot(); p1.setRangeGridlinePaint(Color.black); ChartFrame frame1 = new ChartFrame("Supplier Performance Report", chartProduct); frame1.setVisible(true); frame1.setSize(400, 400); Point pt1 = new Point(0, 0); frame1.setLocation(pt1); }
From source file:User.Interface.InventoryAdminRole.InventoryAdminWorkAreaJPanel.java
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed // TODO add your handling code here: //check if the supplier has products in the product list if (inventoryEnterprise.getWarehouse().getMdeciDeviceCatalog().getMedicalDeviceList().size() < 0) { JOptionPane.showMessageDialog(this, "No devices found in the inventory.", "Warning", JOptionPane.WARNING_MESSAGE); return;//from w w w. ja v a 2 s . c o m } MedicalDevice[] product; product = new MedicalDevice[100]; int numberOfProducts = inventoryEnterprise.getWarehouse().getMdeciDeviceCatalog().getMedicalDeviceList() .size(); DefaultCategoryDataset dataSetProduct = new DefaultCategoryDataset(); for (int i = 0; i < numberOfProducts; i++) { product[i] = inventoryEnterprise.getWarehouse().getMdeciDeviceCatalog().getMedicalDeviceList().get(i); int soldQuantity = 0; soldQuantity = product[i].getNumUses(); String prodName = product[i].getDeviceName(); dataSetProduct.setValue(soldQuantity, "Medical Device", prodName); } JFreeChart chartProduct = ChartFactory.createBarChart("Device Usage Report", "Device", "Number of times usdr", dataSetProduct, PlotOrientation.VERTICAL, false, true, false); CategoryPlot p1 = chartProduct.getCategoryPlot(); p1.setRangeGridlinePaint(Color.black); ChartFrame frame1 = new ChartFrame("Device Usage Report", chartProduct); frame1.setVisible(true); frame1.setSize(400, 400); Point pt1 = new Point(0, 0); frame1.setLocation(pt1); }