use of eu.ggnet.dwoss.util.OkCancelDialog in project dwoss by gg-net.
the class DisplayPanel method main.
// End of variables declaration//GEN-END:variables
public static void main(String[] args) throws Exception {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
// A full Display
// Display display = new Display(Display.Size._15_4, Display.Resolution.HD,
// Display.Type.CRYSTAL_BRIGHT, Display.Ration.SIXTEEN_TO_NINE);
// display.setLed(true);
Display display = new Display(null, null, null, null);
System.out.println(display);
DisplayPanel view = new DisplayPanel(ProductGroup.TABLET_SMARTPHONE);
view.setDisplay(display);
OkCancelDialog<DisplayPanel> create = new OkCancelDialog<>(" ", view);
create.setVisible(true);
if (create.getCloseType() == CloseType.OK) {
System.out.println("Result :" + view.getDisplay());
}
System.exit(0);
}
use of eu.ggnet.dwoss.util.OkCancelDialog in project dwoss by gg-net.
the class AnnulationViewTryout method main.
public static void main(String[] args) {
StockAgent stockStub = mock(StockAgent.class);
Dl.remote().add(StockAgent.class, stockStub);
Position p1 = Position.builder().amount(1).name("P1").price(12.).tax(1.19).build();
Position p2 = Position.builder().amount(1).name("P2").price(20.).tax(1.19).build();
Position p3 = Position.builder().amount(1).name("P3").price(13.24).tax(1.19).build();
Position p4 = Position.builder().amount(1).name("P4").price(400.).tax(1.19).build();
Position p5 = Position.builder().amount(1).name("P5").price(1234.).tax(1.19).build();
List<AfterInvoicePosition> positions = new ArrayList<>();
positions.add(new AfterInvoicePosition(p1));
positions.add(new AfterInvoicePosition(p2));
positions.add(new AfterInvoicePosition(p3));
positions.add(new AfterInvoicePosition(p4));
positions.add(new AfterInvoicePosition(p5));
CreditMemoView view = new CreditMemoView(positions);
OkCancelDialog<CreditMemoView> dialog = new OkCancelDialog<>("Test", view);
dialog.setVisible(true);
System.out.println(view.getPositions());
System.exit(0);
}
use of eu.ggnet.dwoss.util.OkCancelDialog in project dwoss by gg-net.
the class BasicViewTryout method main.
public static void main(String[] args) throws Exception {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
BasicSpec basic = new BasicSpec();
basic.setPartNo("ABX");
basic.setColor(Color.RED);
basic.setComment("Der große Kommentar");
basic.setExtras(EnumSet.of(Extra.BLUETOOTH, Extra.CARD_READER));
basic.setVideoPorts(EnumSet.of(VideoPort.HDMI, VideoPort.VGA));
BasicView view = new BasicView();
view.setSpec(basic);
OkCancelDialog<BasicView> dialog = new OkCancelDialog<>("", view);
dialog.setVisible(true);
if (dialog.getCloseType() == CloseType.OK) {
System.out.println(view.getSpec());
System.out.println(view.getGtin());
}
Thread.sleep(1221);
System.exit(0);
}
use of eu.ggnet.dwoss.util.OkCancelDialog in project dwoss by gg-net.
the class DesktopBundleViewTryout method tryoutView.
@Test
public void tryoutView() throws InterruptedException {
final ProductSpec spec = new SpecGenerator().makeSpec();
DesktopBundleView view = new DesktopBundleView(new Mandators() {
@Override
public Mandator loadMandator() {
return Mandator.builder().defaultMailSignature(null).smtpConfiguration(null).mailTemplateLocation(null).company(CompanyGen.makeCompany()).dossierPrefix("DW").documentIntermix(null).documentIdentifierGeneratorConfigurations(new EnumMap<>(DocumentType.class)).build();
}
@Override
public DefaultCustomerSalesdata loadSalesdata() {
// To change body of generated methods, choose Tools | Templates.
throw new UnsupportedOperationException("loadSalesdata - Not supported yet.");
}
@Override
public ReceiptCustomers loadReceiptCustomers() {
return ReceiptCustomers.builder().build();
}
@Override
public SpecialSystemCustomers loadSystemCustomers() {
// To change body of generated methods, choose Tools | Templates.
throw new UnsupportedOperationException("loadSystemCustomers - Not supported yet.");
}
@Override
public Contractors loadContractors() {
return new Contractors(EnumSet.of(TradeName.ALSO, TradeName.ACER), EnumSet.of(TradeName.ACER));
}
@Override
public PostLedger loadPostLedger() {
// To change body of generated methods, choose Tools | Templates.
throw new UnsupportedOperationException("loadPostLedger - Not supported yet.");
}
@Override
public ShippingTerms loadShippingTerms() {
// To change body of generated methods, choose Tools | Templates.
throw new UnsupportedOperationException("loadShippingTerms - Not supported yet.");
}
}, new SpecAgent() {
@Override
public ProductSpec findProductSpecByPartNoEager(String partNo) {
if (partNo == null)
return null;
if (partNo.startsWith("X"))
return null;
spec.setPartNo(partNo);
return spec;
}
// <editor-fold defaultstate="collapsed" desc="Unneeded Methods">
@Override
public <T> long count(Class<T> entityClass) {
// To change body of generated methods, choose Tools | Templates.
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public <T> List<T> findAll(Class<T> entityClass) {
// To change body of generated methods, choose Tools | Templates.
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public <T> List<T> findAll(Class<T> entityClass, int start, int amount) {
// To change body of generated methods, choose Tools | Templates.
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public <T> List<T> findAllEager(Class<T> entityClass) {
// To change body of generated methods, choose Tools | Templates.
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public <T> List<T> findAllEager(Class<T> entityClass, int start, int amount) {
// To change body of generated methods, choose Tools | Templates.
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public <T> T findById(Class<T> entityClass, Object id) {
// To change body of generated methods, choose Tools | Templates.
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public <T> T findById(Class<T> entityClass, Object id, LockModeType lockModeType) {
// To change body of generated methods, choose Tools | Templates.
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public <T> T findByIdEager(Class<T> entityClass, Object id) {
// To change body of generated methods, choose Tools | Templates.
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public <T> T findByIdEager(Class<T> entityClass, Object id, LockModeType lockModeType) {
// To change body of generated methods, choose Tools | Templates.
throw new UnsupportedOperationException("Not supported yet.");
}
}, new ProductProcessorStub(), TradeName.ACER, TradeName.ACER, ProductGroup.DESKTOP, ProductGroup.MONITOR);
view.setSpec(new DesktopBundle());
OkCancelDialog<DesktopBundleView> dialog = new OkCancelDialog<>("BundleView", view);
dialog.setVisible(true);
dialog.dispose();
}
use of eu.ggnet.dwoss.util.OkCancelDialog in project dwoss by gg-net.
the class AnnulationInvoiceAction method actionPerformed.
@Override
public void actionPerformed(ActionEvent e) {
Calendar release = Calendar.getInstance();
release.setTime(doc.getHistory().getRelease());
Calendar beforeOneYear = Calendar.getInstance();
beforeOneYear.set(Calendar.YEAR, Calendar.getInstance().get(Calendar.YEAR) - 1);
if (beforeOneYear.after(release) && JOptionPane.CANCEL_OPTION == JOptionPane.showConfirmDialog(parent, "Der Vorgang ist über ein Jahr alt und die Garantie ist abgelaufen!\nMöchten sie fortfahren?", "Garantie Warnung", JOptionPane.OK_CANCEL_OPTION)) {
return;
}
List<AfterInvoicePosition> creditPositions = new ArrayList<>();
for (Position position : doc.getPositions().values()) {
if (position.getType() != PositionType.COMMENT)
creditPositions.add(new AfterInvoicePosition(position));
}
CreditMemoView view = new CreditMemoView(creditPositions);
OkCancelDialog<CreditMemoView> dialog = new OkCancelDialog<>(getValue(Action.NAME).toString(), view);
dialog.setLocationRelativeTo(parent);
dialog.setVisible(true);
if (dialog.getCloseType() == CloseType.OK) {
doc.removeAllPositions();
for (Position position : view.getPositions()) {
position.setPrice(position.getPrice() * (-1));
doc.append(position);
}
doc.setType(DocumentType.ANNULATION_INVOICE);
doc.setDirective(Directive.BALANCE_REPAYMENT);
Document d = Dl.remote().lookup(RedTapeWorker.class).update(doc, view.getStockLocation(), Dl.local().lookup(Guardian.class).getUsername());
controller.reloadSelectionOnStateChange(d.getDossier());
}
}
Aggregations