Java tutorial
// Description: Java 8 JavaFX View/Edit Pane implementation for ServerObjFunc. /* * CFBam * * Copyright (c) 2014-2016 Mark Sobkow * * This program is available as free software under the GNU GPL v3, or * under a commercial license from Mark Sobkow. For commercial licensing * details, please contact msobkow@sasktel.net. * * Under the terms of the GPL: * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. * */ package net.sourceforge.msscodefactory.cfbam.v2_7.CFBamJavaFX; import java.math.*; import java.sql.*; import java.text.*; import java.util.*; import javafx.geometry.Orientation; import javafx.scene.control.ScrollPane; import javafx.scene.control.ScrollPane.ScrollBarPolicy; import net.sourceforge.msscodefactory.cflib.v2_7.CFLib.*; import net.sourceforge.msscodefactory.cflib.v2_7.CFLib.JavaFX.*; import org.apache.commons.codec.binary.Base64; import net.sourceforge.msscodefactory.cfsecurity.v2_7.CFSecurity.*; import net.sourceforge.msscodefactory.cfinternet.v2_7.CFInternet.*; import net.sourceforge.msscodefactory.cfbam.v2_7.CFBam.*; import net.sourceforge.msscodefactory.cfsecurity.v2_7.CFSecurityObj.*; import net.sourceforge.msscodefactory.cfinternet.v2_7.CFInternetObj.*; import net.sourceforge.msscodefactory.cfbam.v2_7.CFBamObj.*; /** * CFBamJavaFXServerObjFuncViewEditPane JavaFX View/Edit Pane implementation * for ServerObjFunc. */ public class CFBamJavaFXServerObjFuncViewEditPane extends CFSplitPane implements ICFBamJavaFXServerObjFuncPaneCommon { protected ICFFormManager cfFormManager = null; protected ICFBamJavaFXSchema javafxSchema = null; protected ScrollPane attrScrollPane = null; protected CFGridPane attrPane = null; protected CFTabPane eltTabPane = null; public CFBamJavaFXServerObjFuncViewEditPane(ICFFormManager formManager, ICFBamJavaFXSchema argSchema, ICFBamServerObjFuncObj argFocus) { super(); final String S_ProcName = "construct-schema-focus"; if (formManager == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 1, "formManager"); } cfFormManager = formManager; if (argSchema == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 2, "argSchema"); } // argFocus is optional; focus may be set later during execution as // conditions of the runtime change. javafxSchema = argSchema; setJavaFXFocus(argFocus); attrPane = argSchema.getServerObjFuncFactory().newAttrPane(cfFormManager, argFocus); attrScrollPane = new ScrollPane(); attrScrollPane.setFitToWidth(true); attrScrollPane.setHbarPolicy(ScrollBarPolicy.NEVER); attrScrollPane.setVbarPolicy(ScrollBarPolicy.AS_NEEDED); attrScrollPane.setContent(attrPane); eltTabPane = argSchema.getServerObjFuncFactory().newEltTabPane(cfFormManager, argFocus); setOrientation(Orientation.VERTICAL); getItems().add(attrScrollPane); getItems().add(eltTabPane); } public ICFFormManager getCFFormManager() { return (cfFormManager); } public void setCFFormManager(ICFFormManager value) { final String S_ProcName = "setCFFormManager"; if (value == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 1, "value"); } cfFormManager = value; } public ICFBamJavaFXSchema getJavaFXSchema() { return (javafxSchema); } public void setJavaFXFocus(ICFLibAnyObj value) { final String S_ProcName = "setJavaFXFocus"; if ((value == null) || (value instanceof ICFBamServerObjFuncObj)) { super.setJavaFXFocus(value); } else { throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(), S_ProcName, "value", value, "ICFBamServerObjFuncObj"); } } public void setJavaFXFocusAsServerObjFunc(ICFBamServerObjFuncObj value) { setJavaFXFocus(value); } public ICFBamServerObjFuncObj getJavaFXFocusAsServerObjFunc() { return ((ICFBamServerObjFuncObj) getJavaFXFocus()); } public void setPaneMode(CFPane.PaneMode value) { CFPane.PaneMode oldMode = getPaneMode(); if (oldMode == value) { return; } try { super.setPaneMode(value); ((ICFBamJavaFXServerObjFuncPaneCommon) attrPane).setPaneMode(value); ((ICFBamJavaFXServerObjFuncPaneCommon) eltTabPane).setPaneMode(value); } catch (Throwable t) { super.setPaneMode(oldMode); ((ICFBamJavaFXServerObjFuncPaneCommon) attrPane).setPaneMode(oldMode); ((ICFBamJavaFXServerObjFuncPaneCommon) eltTabPane).setPaneMode(oldMode); throw t; } } }