Skip to content

Commit

Permalink
Take the default values for the spinput configuration from CaGe.ini
Browse files Browse the repository at this point in the history
  • Loading branch information
nvcleemp committed Apr 1, 2015
1 parent e765b58 commit c0deda4
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 5 deletions.
12 changes: 11 additions & 1 deletion CaGe.ini
Original file line number Diff line number Diff line change
Expand Up @@ -239,4 +239,14 @@ RasmolViewer.Title: Rasmol
# is to be checked for questions requiring a user response
RasmolViewer.WatchInterval: 500


# Spinput writer configuration
# if the following property is set to true, then all vertices
# are of the same element type
Spinput.UseSingleElement: false
# if the property above is true, then the following two properties
# specify the specific element to use for each vertex
Spinput.ElementNumber: 6
Spinput.ElementName: C
# the next property specify the scaling that needs to be done.
# Each coordinate will be multiplied with this factor.
Spinput.scaling: 1.0
16 changes: 12 additions & 4 deletions cage/writer/SpinputWriterConfigurationHandler.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package cage.writer;

import cage.CaGe;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Insets;
Expand Down Expand Up @@ -54,11 +55,18 @@ public void configureWriter(CaGeWriter writer) {
}

private static class SpinputWriterConfigurationModel {
private boolean useSingleElementRule = false;
private int singleElementNumber = 6;
private String singleElementName = "C";
private boolean useSingleElementRule;
private int singleElementNumber;
private String singleElementName;

private float scalingFactor = 1.0f;
private float scalingFactor;

public SpinputWriterConfigurationModel() {
useSingleElementRule = CaGe.getCaGePropertyAsBoolean("Spinput.UseSingleElement", false);
singleElementNumber = CaGe.getCaGePropertyAsInt("Spinput.ElementNumber", 6);
singleElementName = CaGe.getCaGeProperty("Spinput.ElementName", "C");
scalingFactor = CaGe.getCaGePropertyAsFloat("Spinput.scaling", 1.0f);
}

private final List<SpinputWriterConfigurationModelListener> listeners =
new ArrayList<>();
Expand Down

0 comments on commit c0deda4

Please sign in to comment.