Search in sources :

Example 6 with AWindow

use of org.compiere.apps.AWindow in project adempiere by adempiere.

the class Viewer method cmd_customize.

/**
	 * 	Call Customize
	 */
private void cmd_customize() {
    AWindow win = new AWindow(getGraphicsConfiguration());
    //	forwards Window Events
    new AWindowListener(win, this);
    //	hardcoded
    int AD_Window_ID = 240;
    int AD_PrintFormat_ID = m_reportEngine.getPrintFormat().get_ID();
    boolean loadedOK = win.initWindow(AD_Window_ID, MQuery.getEqualQuery("AD_PrintFormat_ID", AD_PrintFormat_ID));
    if (loadedOK) {
        AEnv.addToWindowManager(win);
        AEnv.showCenterScreen(win);
    }
//	see windowStateChanged for applying change
}
Also used : AWindow(org.compiere.apps.AWindow) AWindowListener(org.compiere.apps.AWindowListener) Point(java.awt.Point)

Example 7 with AWindow

use of org.compiere.apps.AWindow in project adempiere by adempiere.

the class WFPanel method zoom.

//	resetLayout
/**
	 * 	Zoom to WorkFlow
	 */
private void zoom() {
    if (m_WF_Window_ID <= 0) {
        m_WF_Window_ID = MTable.get(m_ctx, MWorkflow.Table_ID).getAD_Window_ID();
    }
    if (m_WF_Window_ID <= 0) {
        throw new AdempiereException("@NotFound@ @AD_Window_ID@");
    }
    MQuery query = null;
    if (m_wf != null)
        query = MQuery.getEqualQuery("AD_Workflow_ID", m_wf.getAD_Workflow_ID());
    AWindow frame = new AWindow();
    if (!frame.initWindow(m_WF_Window_ID, query))
        return;
    AEnv.addToWindowManager(frame);
    AEnv.showCenterScreen(frame);
    frame = null;
}
Also used : AWindow(org.compiere.apps.AWindow) AdempiereException(org.adempiere.exceptions.AdempiereException) MQuery(org.compiere.model.MQuery)

Example 8 with AWindow

use of org.compiere.apps.AWindow in project adempiere by adempiere.

the class HtmlDashboard method htmlUpdate.

private void htmlUpdate(URL url) {
    if ((url == null) || (url.getPath().equals("/local/home"))) {
        html.setText(createHTML(PAGE_TYPE.PAGE_HOME));
        html.setCaretPosition(0);
        lastUrl = url;
    } else if (url.getPath().equals("/local/logo")) {
        html.setText(createHTML(PAGE_TYPE.PAGE_LOGO));
        html.setCaretPosition(0);
        lastUrl = url;
    } else if (url.getPath().equals("/local/performance")) {
        html.setText(createHTML(PAGE_TYPE.PAGE_PERFORMANCE));
    } else if (url.getPath().equals("/window/node")) {
        /* fcsku 3.7.07
			CButton button = new CButton("");		//	Create the button
			button.setActionCommand(String.valueOf(url.getRef())); //getNode_ID()
			button.addActionListener(treePanel); //VTreePanel
			//AEnv.zoom(130, 0);
			html.setCursor(Cursor.getPredefinedCursor( Cursor.WAIT_CURSOR ));
			button.doClick();
			html.setCursor(Cursor.getPredefinedCursor( Cursor.DEFAULT_CURSOR ));
			*/
        int AD_Window_ID = Integer.parseInt(url.getRef());
        AWindow frame = new AWindow(getGraphicsConfiguration());
        if (//MQuery.getEqualQuery(TableName + "_ID", Record_ID)))
        !frame.initWindow(AD_Window_ID, null))
            return;
        AEnv.addToWindowManager(frame);
        if (Ini.isPropertyBool(Ini.P_OPEN_WINDOW_MAXIMIZED)) {
            AEnv.showMaximized(frame);
        } else {
            AEnv.showCenterScreen(frame);
        }
        frame = null;
        html.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
    } else if (url.getPath().equals("/window/zoom")) {
        int index = Integer.parseInt(String.valueOf(url.getRef()));
        if ((index >= 0) && (index < queryZoom.size())) {
            html.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
            AEnv.zoom(queryZoom.get(index));
            html.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
        }
    } else if (url != null) {
        // Load some cursors
        Cursor cursor = html.getCursor();
        html.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
        SwingUtilities.invokeLater(new PageLoader(html, url, cursor));
        lastUrl = url;
    }
}
Also used : AWindow(org.compiere.apps.AWindow) Cursor(java.awt.Cursor)

Example 9 with AWindow

use of org.compiere.apps.AWindow in project adempiere by adempiere.

the class DocumentSearch method openWindow.

@Override
protected boolean openWindow(int windowId, MQuery query) {
    final AWindow frame = new AWindow();
    AEnv.addToWindowManager(frame);
    if (frame.initWindow(windowId, query)) {
        frame.pack();
        AEnv.showCenterScreen(frame);
    }
    return true;
}
Also used : AWindow(org.compiere.apps.AWindow)

Example 10 with AWindow

use of org.compiere.apps.AWindow in project adempiere by adempiere.

the class VPAttributeDialog method cmd_zoom.

//	cmd_newEdit
/**
	 * 	Zoom M_Lot
	 */
private void cmd_zoom() {
    int M_Lot_ID = 0;
    KeyNamePair pp = (KeyNamePair) fieldLot.getSelectedItem();
    if (pp != null)
        M_Lot_ID = pp.getKey();
    MQuery zoomQuery = new MQuery("M_Lot");
    zoomQuery.addRestriction("M_Lot_ID", MQuery.EQUAL, M_Lot_ID);
    log.info(zoomQuery.toString());
    //
    setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
    //
    //	Lot
    int AD_Window_ID = MWindow.getWindow_ID("Lot");
    AWindow frame = new AWindow();
    if (frame.initWindow(AD_Window_ID, zoomQuery)) {
        this.setVisible(false);
        //	otherwise blocked
        this.setModal(false);
        this.setVisible(true);
        AEnv.addToWindowManager(frame);
        AEnv.showScreen(frame, SwingConstants.EAST);
    }
    //  async window - not able to get feedback
    frame = null;
    //
    setCursor(Cursor.getDefaultCursor());
}
Also used : AWindow(org.compiere.apps.AWindow) MQuery(org.compiere.model.MQuery) KeyNamePair(org.compiere.util.KeyNamePair) ALayoutConstraint(org.compiere.apps.ALayoutConstraint)

Aggregations

AWindow (org.compiere.apps.AWindow)12 MQuery (org.compiere.model.MQuery)6 SQLException (java.sql.SQLException)3 PropertyVetoException (java.beans.PropertyVetoException)2 Cursor (java.awt.Cursor)1 Point (java.awt.Point)1 PreparedStatement (java.sql.PreparedStatement)1 ResultSet (java.sql.ResultSet)1 AdempiereException (org.adempiere.exceptions.AdempiereException)1 DBException (org.adempiere.exceptions.DBException)1 ALayoutConstraint (org.compiere.apps.ALayoutConstraint)1 AWindowListener (org.compiere.apps.AWindowListener)1 FormFrame (org.compiere.apps.form.FormFrame)1 MLookup (org.compiere.model.MLookup)1 CFrame (org.compiere.swing.CFrame)1 KeyNamePair (org.compiere.util.KeyNamePair)1 ValueNamePair (org.compiere.util.ValueNamePair)1 MWFNode (org.compiere.wf.MWFNode)1