Search in sources :

Example 16 with PropertyVetoException

use of java.beans.PropertyVetoException in project sic by belluccifranco.

the class PrincipalGUI method mnu_CajasActionPerformed.

//GEN-LAST:event_mnuItm_PedidosActionPerformed
private void mnu_CajasActionPerformed(java.awt.event.ActionEvent evt) {
    //GEN-FIRST:event_mnu_CajasActionPerformed
    JInternalFrame gui = Utilidades.estaEnDesktop(getDesktopPane(), CajasGUI.class);
    if (gui == null) {
        gui = new CajasGUI();
        gui.setLocation(getDesktopPane().getWidth() / 2 - gui.getWidth() / 2, getDesktopPane().getHeight() / 2 - gui.getHeight() / 2);
        getDesktopPane().add(gui);
        gui.setVisible(true);
    } else {
        //selecciona y trae al frente el internalframe
        try {
            gui.setSelected(true);
        } catch (PropertyVetoException ex) {
            String msjError = "No se pudo seleccionar la ventana requerida.";
            LOGGER.error(msjError + " - " + ex.getMessage());
            JOptionPane.showInternalMessageDialog(this.getDesktopPane(), msjError, "Error", JOptionPane.ERROR_MESSAGE);
        }
    }
}
Also used : PropertyVetoException(java.beans.PropertyVetoException) JInternalFrame(javax.swing.JInternalFrame)

Example 17 with PropertyVetoException

use of java.beans.PropertyVetoException in project sic by belluccifranco.

the class PrincipalGUI method mnuItm_FacturasVentaActionPerformed.

//GEN-LAST:event_mnuItm_IrTPVActionPerformed
private void mnuItm_FacturasVentaActionPerformed(java.awt.event.ActionEvent evt) {
    //GEN-FIRST:event_mnuItm_FacturasVentaActionPerformed
    JInternalFrame gui = Utilidades.estaEnDesktop(getDesktopPane(), FacturasVentaGUI.class);
    if (gui == null) {
        gui = new FacturasVentaGUI();
        gui.setLocation(getDesktopPane().getWidth() / 2 - gui.getWidth() / 2, getDesktopPane().getHeight() / 2 - gui.getHeight() / 2);
        getDesktopPane().add(gui);
        gui.setVisible(true);
    } else {
        //selecciona y trae al frente el internalframe
        try {
            gui.setSelected(true);
        } catch (PropertyVetoException ex) {
            String msjError = "No se pudo seleccionar la ventana requerida.";
            LOGGER.error(msjError + " - " + ex.getMessage());
            JOptionPane.showInternalMessageDialog(this.getDesktopPane(), msjError, "Error", JOptionPane.ERROR_MESSAGE);
        }
    }
}
Also used : PropertyVetoException(java.beans.PropertyVetoException) JInternalFrame(javax.swing.JInternalFrame)

Example 18 with PropertyVetoException

use of java.beans.PropertyVetoException in project sic by belluccifranco.

the class PrincipalGUI method mnuItm_ProveedoresActionPerformed.

//GEN-LAST:event_mnuItm_UsuariosActionPerformed
private void mnuItm_ProveedoresActionPerformed(java.awt.event.ActionEvent evt) {
    //GEN-FIRST:event_mnuItm_ProveedoresActionPerformed
    JInternalFrame gui = Utilidades.estaEnDesktop(getDesktopPane(), ProveedoresGUI.class);
    if (gui == null) {
        gui = new ProveedoresGUI();
        gui.setLocation(getDesktopPane().getWidth() / 2 - gui.getWidth() / 2, getDesktopPane().getHeight() / 2 - gui.getHeight() / 2);
        getDesktopPane().add(gui);
        gui.setVisible(true);
    } else {
        //selecciona y trae al frente el internalframe
        try {
            gui.setSelected(true);
        } catch (PropertyVetoException ex) {
            String msjError = "No se pudo seleccionar la ventana requerida.";
            LOGGER.error(msjError + " - " + ex.getMessage());
            JOptionPane.showInternalMessageDialog(this.getDesktopPane(), msjError, "Error", JOptionPane.ERROR_MESSAGE);
        }
    }
}
Also used : PropertyVetoException(java.beans.PropertyVetoException) JInternalFrame(javax.swing.JInternalFrame)

Example 19 with PropertyVetoException

use of java.beans.PropertyVetoException in project sic by belluccifranco.

the class PrincipalGUI method mnuItm_ClientesActionPerformed.

//GEN-LAST:event_mnuItm_ProductosActionPerformed
private void mnuItm_ClientesActionPerformed(java.awt.event.ActionEvent evt) {
    //GEN-FIRST:event_mnuItm_ClientesActionPerformed
    JInternalFrame gui = Utilidades.estaEnDesktop(getDesktopPane(), ClientesGUI.class);
    if (gui == null) {
        gui = new ClientesGUI();
        gui.setLocation(getDesktopPane().getWidth() / 2 - gui.getWidth() / 2, getDesktopPane().getHeight() / 2 - gui.getHeight() / 2);
        getDesktopPane().add(gui);
        gui.setVisible(true);
    } else {
        //selecciona y trae al frente el internalframe
        try {
            gui.setSelected(true);
        } catch (PropertyVetoException ex) {
            String msjError = "No se pudo seleccionar la ventana requerida.";
            LOGGER.error(msjError + " - " + ex.getMessage());
            JOptionPane.showInternalMessageDialog(this.getDesktopPane(), msjError, "Error", JOptionPane.ERROR_MESSAGE);
        }
    }
}
Also used : PropertyVetoException(java.beans.PropertyVetoException) JInternalFrame(javax.swing.JInternalFrame)

Example 20 with PropertyVetoException

use of java.beans.PropertyVetoException in project GCViewer by chewiebug.

the class Arrange method actionPerformed.

public void actionPerformed(final ActionEvent e) {
    final JInternalFrame[] frames = gcViewer.getDesktopPane().getAllFrames();
    final DesktopManager desktopManager = gcViewer.getDesktopPane().getDesktopManager();
    for (int i = 0; i < frames.length; i++) {
        final JInternalFrame frame = frames[i];
        desktopManager.deiconifyFrame(frame);
        try {
            frame.setMaximum(false);
        } catch (PropertyVetoException e1) {
            e1.printStackTrace();
        }
        final int height = gcViewer.getDesktopPane().getHeight() / frames.length;
        desktopManager.setBoundsForFrame(frame, 0, height * i, gcViewer.getDesktopPane().getWidth(), height);
    }
}
Also used : PropertyVetoException(java.beans.PropertyVetoException) DesktopManager(javax.swing.DesktopManager) JInternalFrame(javax.swing.JInternalFrame)

Aggregations

PropertyVetoException (java.beans.PropertyVetoException)49 JInternalFrame (javax.swing.JInternalFrame)12 Date (java.util.Date)7 ComboPooledDataSource (com.mchange.v2.c3p0.ComboPooledDataSource)4 PropertyChangeEvent (java.beans.PropertyChangeEvent)4 Point (java.awt.Point)3 VetoableChangeListener (java.beans.VetoableChangeListener)3 SQLException (java.sql.SQLException)3 OBlock (jmri.jmrit.logix.OBlock)3 OBlockManager (jmri.jmrit.logix.OBlockManager)3 ActionEvent (java.awt.event.ActionEvent)2 IndexedPropertyChangeEvent (java.beans.IndexedPropertyChangeEvent)2 VetoableChangeSupport (java.beans.VetoableChangeSupport)2 File (java.io.File)2 IOException (java.io.IOException)2 BigDecimal (java.math.BigDecimal)2 PreparedStatement (java.sql.PreparedStatement)2 ResultSet (java.sql.ResultSet)2 Timestamp (java.sql.Timestamp)2 ArrayList (java.util.ArrayList)2