/** Descripción de Método */ private void lock() { // log.info("..."); JFrame frame = Env.getFrame((Container) m_parent); if (frame instanceof AWindow) { ((AWindow) frame).setBusyTimer(m_pi.getEstSeconds()); } else { m_waiting = new Waiting(frame, Msg.getMsg(Env.getCtx(), "Processing"), false, m_pi.getEstSeconds()); } SwingUtilities.invokeLater( new Runnable() { public void run() { log.finer("lock"); m_parent.lockUI(m_pi); } }); if (m_waiting != null) { m_waiting.toFront(); m_waiting.setVisible(true); } } // lock
/** Play the media */ public void play() { synchronized (this) { if (!mPlaying) { /* HACK: stop() reset the audio output, so set it again before first play. */ if (mAudioReset) { if (mAudioOutput != null) nativeSetAudioOutput(mAudioOutput); if (mAudioOutputDevice != null) nativeSetAudioOutputDevice(mAudioOutputDevice); mAudioReset = false; } mPlayRequested = true; if (mWindow.areSurfacesWaiting()) return; } mPlaying = true; } nativePlay(); }
/** remove video size changed callback. */ public void removeOnVideoSizeChangedListener() { mOnVideoSizeChangedListener = null; mWindow.removeCallback(this); mWindow.detachViews(); }
/** * Register a callback to be invoked when the video size is known or updated. * * @param listener the callback that will be run */ public void setOnVideoSizeChangedListener(onVideoSizeChangedListener listener) { mOnVideoSizeChangedListener = listener; mWindow.addCallback(this); mWindow.attachViews(); }
public void sendMouseEvent(int action, int button, int x, int y) { mWindow.sendMouseEvent(action, button, x, y); }
public void setWindowSize(int width, int height) { mWindow.setWindowSize(width, height); }
public void setVideoView2(SurfaceView view) { mWindow.setVideoView2(view); }
public void setVideoSurface2Showing(boolean isShow) { mWindow.setVideoSurface2Showing(isShow); }
public void setSubtitlesView(SurfaceView subtitlesSurfaceView) { mWindow.setSubtitlesView(subtitlesSurfaceView); }
/** Process Button Pressed - Process Matching */ private void cmd_newProduct() { // Selecciono el departamento int depart = 0; String SQL = "Select XX_VMR_DEPARTMENT_ID " + "from XX_VMR_VENDORPRODREF " + "where XX_VMR_VENDORPRODREF_ID=" + LineRefProv.getXX_VMR_VendorProdRef_ID(); try { PreparedStatement pstmt = DB.prepareStatement(SQL, null); ResultSet rs = pstmt.executeQuery(); while (rs.next()) { depart = rs.getInt("XX_VMR_DEPARTMENT_ID"); } rs.close(); pstmt.close(); } catch (Exception a) { log.log(Level.SEVERE, SQL, a); } MVMRVendorProdRef vendorProdRef = new MVMRVendorProdRef(Env.getCtx(), LineRefProv.getXX_VMR_VendorProdRef_ID(), null); if (vendorProdRef.getXX_VMR_ProductClass_ID() > 0 && vendorProdRef.getXX_VMR_TypeLabel_ID() > 0) { MOrder order = new MOrder(Env.getCtx(), LineRefProv.getC_Order_ID(), null); // Selecciono el departamento X_XX_VMR_Department dept = new X_XX_VMR_Department(Env.getCtx(), vendorProdRef.getXX_VMR_Department_ID(), null); int category = dept.getXX_VMR_Category_ID(); // Selecciono la línea X_XX_VMR_Line line = new X_XX_VMR_Line(Env.getCtx(), vendorProdRef.getXX_VMR_Line_ID(), null); int typeInventory = line.getXX_VMR_TypeInventory_ID(); MProduct newProduct = new MProduct( Env.getCtx(), vendorProdRef.getXX_VMR_Department_ID(), vendorProdRef.getXX_VMR_Line_ID(), vendorProdRef.getXX_VMR_Section_ID(), vendorProdRef.get_ID(), vendorProdRef.getC_TaxCategory_ID(), vendorProdRef.getXX_VME_ConceptValue_ID(), typeInventory, null); // Se buscará si por la referencia para producto ya existe para asignarle el Tipo de // Exhibición String sql = "select * from M_Product where XX_VMR_DEPARTMENT_ID = " + vendorProdRef.getXX_VMR_Department_ID() + " and " + "XX_VMR_LINE_ID = " + vendorProdRef.getXX_VMR_Line_ID() + " and XX_VMR_SECTION_ID = " + vendorProdRef.getXX_VMR_Section_ID() + " and " + "XX_VMR_VendorProdRef_id = " + vendorProdRef.getXX_VMR_VendorProdRef_ID() + " order by M_Product_ID desc"; PreparedStatement pstmt = DB.prepareStatement(sql, null); ResultSet rs = null; try { rs = pstmt.executeQuery(); if (rs.next()) newProduct.setXX_VMR_TypeExhibition_ID(rs.getInt("XX_VMR_TypeExhibition_ID")); } catch (SQLException e) { e.printStackTrace(); } finally { DB.closeResultSet(rs); DB.closeStatement(pstmt); } if (vendorProdRef.getXX_VMR_Section_ID() > 0) { X_XX_VMR_Section section = new X_XX_VMR_Section(Env.getCtx(), vendorProdRef.getXX_VMR_Section_ID(), null); newProduct.setName(section.getName()); } else { newProduct.setName(vendorProdRef.getName()); } newProduct.setXX_VMR_Category_ID(category); newProduct.setXX_VMR_LongCharacteristic_ID(vendorProdRef.getXX_VMR_LongCharacteristic_ID()); newProduct.setXX_VMR_Brand_ID(vendorProdRef.getXX_VMR_Brand_ID()); newProduct.setXX_VMR_UnitConversion_ID(vendorProdRef.getXX_VMR_UnitConversion_ID()); newProduct.setXX_PiecesBySale_ID(vendorProdRef.getXX_PiecesBySale_ID()); newProduct.setXX_VMR_UnitPurchase_ID(vendorProdRef.getXX_VMR_UnitPurchase_ID()); newProduct.setXX_SaleUnit_ID(vendorProdRef.getXX_SaleUnit_ID()); newProduct.setC_Country_ID(order.getC_Country_ID()); newProduct.setIsActive(true); newProduct.setC_BPartner_ID(vendorProdRef.getC_BPartner_ID()); newProduct.setXX_VMR_TypeLabel_ID(vendorProdRef.getXX_VMR_TypeLabel_ID()); newProduct.setXX_VMR_ProductClass_ID(vendorProdRef.getXX_VMR_ProductClass_ID()); newProduct.setM_AttributeSet_ID(Env.getCtx().getContextAsInt("#XX_L_P_ATTRIBUTESETST_ID")); newProduct.setProductType(X_Ref_M_Product_ProductType.ITEM.getValue()); newProduct.save(); } else { // Creo variables de sesion para atraparlas en la ventana producto Env.getCtx().setContext("#Depart_Aux", depart); Env.getCtx().setContext("#Section_Aux", LineRefProv.getXX_VMR_Section_ID()); Env.getCtx().setContext("#Line_Aux", LineRefProv.getXX_VMR_Line_ID()); Env.getCtx().setContext("#VendorRef_Aux", LineRefProv.getXX_VMR_VendorProdRef_ID()); Env.getCtx().setContext("#FromProcess_Aux", "Y"); AWindow window_product = new AWindow(); Query query = Query.getNoRecordQuery("M_Product", true); window_product.initWindow(140, query); AEnv.showCenterScreen(window_product); // Obtenemos el GridController para setear la variable m_changed=true JRootPane jRootPane = ((JRootPane) window_product.getComponent(0)); JLayeredPane jLayeredPane = (JLayeredPane) jRootPane.getComponent(1); JPanel jPanel = (JPanel) jLayeredPane.getComponent(0); APanel aPanel = (APanel) jPanel.getComponent(0); VTabbedPane vTabbedPane = (VTabbedPane) aPanel.getComponent(0); GridController gridController = (GridController) vTabbedPane.getComponent(0); GridTable mTable = gridController.getMTab().getTableModel(); mTable.setChanged(true); MProduct.loadLineRefProv(LineRefProv, Env.getCtx()); // Borro las variables de sesion creadas Env.getCtx().remove("#Depart_Aux"); Env.getCtx().remove("#FromProcess_Aux"); Env.getCtx().remove("#Line_Aux"); Env.getCtx().remove("#Section_Aux"); Env.getCtx().remove("#VendorRef_Aux"); } } // cmd_newProduct