Search in sources :

Example 1 with IntegerSelector

use of maspack.widgets.IntegerSelector in project artisynth_core by artisynth.

the class FemModel3dAgent method createMeshPropPanel.

private void createMeshPropPanel() {
    meshPropPanel = new LabeledComponentPanel();
    gridDimField = new VectorField("widths", DEFAULT_GRID_DIM, "%8.3f");
    gridDivField = new IntegerMultiField("divisions", DEFAULT_GRID_DIV, "%d");
    gridDimField.setStretchable(true);
    gridDivField.setStretchable(true);
    tubeDimField = new VectorField("widths (L, rin, rout)", DEFAULT_TUBE_DIM, "%8.3f");
    tubeDivField = new IntegerMultiField("divisions (nt, nl, nr)", DEFAULT_TUBE_DIV, "%d");
    tubeDimField.setStretchable(true);
    tubeDivField.setStretchable(true);
    torusDimField = new VectorField("widths (R, rin, rout)", DEFAULT_TORUS_DIM, "%8.3f");
    torusDivField = new IntegerMultiField("divisions (nt, nl, nr)", DEFAULT_TORUS_DIV, "%d");
    torusDimField.setStretchable(true);
    torusDivField.setStretchable(true);
    sphereNodesField = new IntegerSelector("node count", SPHERE_NODE_OPTIONS);
    extrusDepthField = new DoubleField("depth", DEFAULT_EXTRUSION_DEPTH, "%8.3f");
    extrusLayersField = new IntegerField("layers", DEFAULT_EXTRUSION_LAYERS, "%d");
    extrusFileField = createFileChooser("obj file", null, "obj");
    extrusFileField.setAlignmentX(Component.LEFT_ALIGNMENT);
    extrusDepthField.setStretchable(true);
    extrusLayersField.setStretchable(true);
    ansysNodeFileField = createFileChooser("node file", null, "node");
    ansysNodeFileField.setAlignmentX(Component.LEFT_ALIGNMENT);
    ansysElemFileField = createFileChooser("elem file", null, "elem");
    ansysElemFileField.setAlignmentX(Component.LEFT_ALIGNMENT);
    tetgenNodeFileField = createFileChooser("node file", null, "node");
    tetgenNodeFileField.setAlignmentX(Component.LEFT_ALIGNMENT);
    tetgenEleFileField = createFileChooser("ele file", null, "ele");
    tetgenEleFileField.setAlignmentX(Component.LEFT_ALIGNMENT);
    ucdMeshFileField = createFileChooser("INP file", null, "inp");
    ucdMeshFileField.setAlignmentX(Component.LEFT_ALIGNMENT);
    surfaceMeshFileField = createFileChooser("OBJ file", null, "obj");
    surfaceMeshFileField.setAlignmentX(Component.LEFT_ALIGNMENT);
    scaleField = new ScaleField("scale", 1);
    scaleField.setStretchable(true);
    autoScaleBtn = new JButton("auto scale");
    autoScaleBtn.addActionListener(this);
    scaleField.addMajorComponent(autoScaleBtn);
    restoreDefaultValues();
    if (mySettings != null) {
        meshSelector.maskValueChangeListeners(true);
        meshSelector.setValue(mySettings.meshType);
        meshSelector.maskValueChangeListeners(false);
        gridDimField.setValue(mySettings.gridWidths);
        gridDivField.setValue(mySettings.gridDivisions);
        tubeDimField.setValue(mySettings.tubeWidths);
        tubeDivField.setValue(mySettings.tubeDivisions);
        torusDimField.setValue(mySettings.torusWidths);
        torusDivField.setValue(mySettings.torusDivisions);
        sphereNodesField.setValue(mySettings.sphereNodes);
        extrusDepthField.setValue(mySettings.extrusionDepth);
        extrusLayersField.setValue(mySettings.extrusionLayers);
        if (new File(mySettings.extrusionFile).isFile()) {
            extrusFileField.setValue(mySettings.extrusionFile);
        }
        if (new File(mySettings.ansysNodeFile).isFile()) {
            ansysNodeFileField.setValue(mySettings.ansysNodeFile);
        }
        if (new File(mySettings.ansysElemFile).isFile()) {
            ansysElemFileField.setValue(mySettings.ansysElemFile);
        }
        if (new File(mySettings.tetgenNodeFile).isFile()) {
            tetgenNodeFileField.setValue(mySettings.tetgenNodeFile);
        }
        if (new File(mySettings.tetgenEleFile).isFile()) {
            tetgenEleFileField.setValue(mySettings.tetgenEleFile);
        }
        if (new File(mySettings.ucdFile).isFile()) {
            ucdMeshFileField.setValue(mySettings.ucdFile);
        }
        if (new File(mySettings.surfaceMeshFile).isFile()) {
            surfaceMeshFileField.setValue(mySettings.surfaceMeshFile);
        }
    }
    updateMeshPanel();
}
Also used : VectorField(maspack.widgets.VectorField) IntegerSelector(maspack.widgets.IntegerSelector) IntegerMultiField(maspack.widgets.IntegerMultiField) JButton(javax.swing.JButton) IntegerField(maspack.widgets.IntegerField) LabeledComponentPanel(maspack.widgets.LabeledComponentPanel) File(java.io.File) DoubleField(maspack.widgets.DoubleField) ScaleField(maspack.widgets.ScaleField)

Aggregations

File (java.io.File)1 JButton (javax.swing.JButton)1 DoubleField (maspack.widgets.DoubleField)1 IntegerField (maspack.widgets.IntegerField)1 IntegerMultiField (maspack.widgets.IntegerMultiField)1 IntegerSelector (maspack.widgets.IntegerSelector)1 LabeledComponentPanel (maspack.widgets.LabeledComponentPanel)1 ScaleField (maspack.widgets.ScaleField)1 VectorField (maspack.widgets.VectorField)1