Skip to content

Commit d82fbd6

Browse files
authored
Merge pull request #4 from datazuul/focus-settings
Add focus controls
2 parents e1eeb0c + 8b51515 commit d82fbd6

13 files changed

+387
-101
lines changed

CONTRIBUTING.md

+26
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ Please test the application with your cameras and report success/failure under <
88

99
* Canon Hack Development Kit (on camera): <https://chdk.fandom.com/wiki/CHDK>
1010
* CHDK-PTP-Java: Our fork <https://github.com/datazuul/CHDK-PTP-Java> of <https://github.com/acamilo/CHDK-PTP-Java>
11+
* USB4Java: <http://usb4java.org/usb4java-javax/>
1112

1213
## Development
1314

@@ -24,3 +25,28 @@ Make sure source code at least compiles with `mvn clean install`.
2425

2526
This software is based on [Apache NetBeans Platform ](http://netbeans.apache.org/kb/docs/platform/index.html).
2627
Main part of application is in submodule `application` and is easy to understand if you are familiar with [Swing](https://docs.oracle.com/javase/tutorial/uiswing/index.html).
28+
29+
## Creating distribution Package
30+
31+
After executing `mvn clean install` in parent package, a ZIP-distribution package is created,
32+
located in `application/target/`, e.g. named `eazy-bookscanner-app-0.2.0-SNAPSHOT.zip`.
33+
34+
This package contains the whole application and all dependencies, ready for execution after unpacking (see contained `bin` folder).
35+
36+
Problem: Depending on development environment (?) the contained configuration file `etc/eazybookscanner.conf` contains wrong default values.
37+
38+
Solution: Edit file `application/target/eazybookscanner/etc/eazybookscanner.conf` manually and
39+
make sure that default values are:
40+
41+
```
42+
default_userdir="${DEFAULT_USERDIR_ROOT}"
43+
default_cachedir="${DEFAULT_CACHEDIR_ROOT}"
44+
```
45+
46+
and create ZIP file manually by zipping directory `application/target/eazybookscanner`.
47+
48+
Linux zip example:
49+
50+
```
51+
$ zip -r eazy-bookscanner-app-0.2.0-SNAPSHOT.zip eazybookscanner/
52+
```

application/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<parent>
77
<groupId>com.datazuul</groupId>
88
<artifactId>eazy-bookscanner-parent</artifactId>
9-
<version>0.1.0-SNAPSHOT</version>
9+
<version>0.2.0-SNAPSHOT</version>
1010
</parent>
1111

1212
<name>Eazy BookScanner (app)</name>

branding/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<parent>
77
<groupId>com.datazuul</groupId>
88
<artifactId>eazy-bookscanner-parent</artifactId>
9-
<version>0.1.0-SNAPSHOT</version>
9+
<version>0.2.0-SNAPSHOT</version>
1010
</parent>
1111

1212
<name>Eazy BookScanner (branding)</name>

core/pom.xml

+6-6
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<groupId>com.datazuul</groupId>
77
<artifactId>eazy-bookscanner-parent</artifactId>
8-
<version>0.1.0-SNAPSHOT</version>
8+
<version>0.2.0-SNAPSHOT</version>
99
</parent>
1010

1111
<name>Eazy BookScanner (core)</name>
@@ -17,11 +17,6 @@
1717
</properties>
1818

1919
<dependencies>
20-
<!-- <dependency>
21-
<groupId>com.datazuul.apps</groupId>
22-
<artifactId>datazuul-bookscan</artifactId>
23-
<version>0.1.0-SNAPSHOT</version>
24-
</dependency>-->
2520
<dependency>
2621
<groupId>com.neuronrobotics</groupId>
2722
<artifactId>CHDK-PTP-Java</artifactId>
@@ -87,6 +82,11 @@
8782
<artifactId>org-openide-filesystems-nb</artifactId>
8883
<version>RELEASE90</version>
8984
</dependency>
85+
<dependency>
86+
<groupId>org.netbeans.api</groupId>
87+
<artifactId>org-openide-filesystems</artifactId>
88+
<version>RELEASE90</version>
89+
</dependency>
9090
</dependencies>
9191

9292
<build>

core/src/main/java/com/datazuul/bookscanner/core/CameraPanel.form

+98-20
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
<?xml version="1.0" encoding="UTF-8" ?>
22

33
<Form version="1.5" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
4+
<NonVisualComponents>
5+
<Component class="javax.swing.ButtonGroup" name="focusButtonGroup">
6+
</Component>
7+
</NonVisualComponents>
8+
<Properties>
9+
<Property name="maximumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
10+
<Dimension value="[32767, 103]"/>
11+
</Property>
12+
</Properties>
413
<AuxValues>
514
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
615
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
@@ -18,39 +27,69 @@
1827
<Group type="103" groupAlignment="0" attributes="0">
1928
<Group type="102" attributes="0">
2029
<EmptySpace max="-2" attributes="0"/>
21-
<Group type="103" groupAlignment="0" attributes="0">
30+
<Group type="103" groupAlignment="0" max="-2" attributes="0">
2231
<Group type="102" attributes="0">
23-
<Component id="cameraName" min="-2" max="-2" attributes="0"/>
24-
<EmptySpace max="32767" attributes="0"/>
25-
<Component id="rotationLabel" min="-2" max="-2" attributes="0"/>
32+
<Component id="zoomLabel" min="-2" max="-2" attributes="0"/>
2633
<EmptySpace max="-2" attributes="0"/>
27-
<Component id="rotationSpinner" min="-2" pref="52" max="-2" attributes="0"/>
34+
<Component id="zoomSlider" min="-2" max="-2" attributes="0"/>
2835
</Group>
29-
<Group type="102" attributes="0">
30-
<Component id="zoomLabel" min="-2" max="-2" attributes="0"/>
36+
<Component id="cameraName" max="32767" attributes="0"/>
37+
</Group>
38+
<EmptySpace pref="38" max="32767" attributes="0"/>
39+
<Group type="103" groupAlignment="0" max="-2" attributes="0">
40+
<Group type="102" alignment="0" attributes="0">
41+
<Component id="focusGroupLabel" min="-2" max="-2" attributes="0"/>
3142
<EmptySpace max="-2" attributes="0"/>
32-
<Component id="zoomSlider" pref="398" max="32767" attributes="0"/>
43+
<Group type="103" groupAlignment="0" attributes="0">
44+
<Component id="autoFocusRadioButton" alignment="0" min="-2" max="-2" attributes="0"/>
45+
<Group type="102" alignment="0" attributes="0">
46+
<Component id="manualFocusRadioButton" min="-2" max="-2" attributes="0"/>
47+
<EmptySpace max="-2" attributes="0"/>
48+
<Component id="manualFocusSpinner" min="-2" pref="59" max="-2" attributes="0"/>
49+
</Group>
50+
</Group>
51+
</Group>
52+
<Group type="102" alignment="0" attributes="0">
53+
<Component id="rotationLabel" min="-2" max="-2" attributes="0"/>
54+
<EmptySpace max="32767" attributes="0"/>
55+
<Component id="rotationSpinner" min="-2" pref="59" max="-2" attributes="0"/>
3356
</Group>
3457
</Group>
35-
<EmptySpace max="-2" attributes="0"/>
58+
<EmptySpace max="32767" attributes="0"/>
3659
</Group>
3760
</Group>
3861
</DimensionLayout>
3962
<DimensionLayout dim="1">
4063
<Group type="103" groupAlignment="0" attributes="0">
41-
<Group type="102" alignment="0" attributes="0">
42-
<EmptySpace min="-2" pref="13" max="-2" attributes="0"/>
43-
<Group type="103" groupAlignment="3" attributes="0">
44-
<Component id="cameraName" alignment="3" min="-2" max="-2" attributes="0"/>
45-
<Component id="rotationSpinner" alignment="3" min="-2" max="-2" attributes="0"/>
46-
<Component id="rotationLabel" alignment="3" min="-2" max="-2" attributes="0"/>
47-
</Group>
48-
<EmptySpace type="unrelated" min="-2" max="-2" attributes="0"/>
64+
<Group type="102" attributes="0">
4965
<Group type="103" groupAlignment="0" attributes="0">
50-
<Component id="zoomLabel" min="-2" max="-2" attributes="0"/>
51-
<Component id="zoomSlider" min="-2" max="-2" attributes="0"/>
66+
<Group type="102" attributes="0">
67+
<EmptySpace min="-2" pref="13" max="-2" attributes="0"/>
68+
<Group type="103" groupAlignment="3" attributes="0">
69+
<Component id="cameraName" alignment="3" min="-2" max="-2" attributes="0"/>
70+
<Component id="rotationSpinner" alignment="3" min="-2" max="-2" attributes="0"/>
71+
<Component id="rotationLabel" alignment="3" min="-2" max="-2" attributes="0"/>
72+
</Group>
73+
<EmptySpace type="unrelated" min="-2" max="-2" attributes="0"/>
74+
<Group type="103" groupAlignment="0" attributes="0">
75+
<Component id="zoomLabel" alignment="0" min="-2" max="-2" attributes="0"/>
76+
<Group type="103" alignment="0" groupAlignment="3" attributes="0">
77+
<Component id="focusGroupLabel" alignment="3" min="-2" max="-2" attributes="0"/>
78+
<Component id="autoFocusRadioButton" alignment="3" min="-2" max="-2" attributes="0"/>
79+
</Group>
80+
</Group>
81+
<EmptySpace max="-2" attributes="0"/>
82+
<Group type="103" groupAlignment="3" attributes="0">
83+
<Component id="manualFocusSpinner" alignment="3" min="-2" max="-2" attributes="0"/>
84+
<Component id="manualFocusRadioButton" alignment="3" min="-2" max="-2" attributes="0"/>
85+
</Group>
86+
</Group>
87+
<Group type="102" attributes="0">
88+
<EmptySpace min="45" pref="45" max="-2" attributes="0"/>
89+
<Component id="zoomSlider" min="-2" max="-2" attributes="0"/>
90+
</Group>
5291
</Group>
53-
<EmptySpace min="0" pref="0" max="-2" attributes="0"/>
92+
<EmptySpace pref="12" max="32767" attributes="0"/>
5493
</Group>
5594
</Group>
5695
</DimensionLayout>
@@ -70,6 +109,7 @@
70109
<Property name="paintLabels" type="boolean" value="true"/>
71110
<Property name="paintTicks" type="boolean" value="true"/>
72111
<Property name="snapToTicks" type="boolean" value="true"/>
112+
<Property name="value" type="int" value="0"/>
73113
</Properties>
74114
<Events>
75115
<EventHandler event="stateChanged" listener="javax.swing.event.ChangeListener" parameters="javax.swing.event.ChangeEvent" handler="zoomSliderStateChanged"/>
@@ -102,5 +142,43 @@
102142
<Property name="toolTipText" type="java.lang.String" value="degrees each taken image should be rotated"/>
103143
</Properties>
104144
</Component>
145+
<Component class="javax.swing.JLabel" name="focusGroupLabel">
146+
<Properties>
147+
<Property name="text" type="java.lang.String" value="Focus:"/>
148+
</Properties>
149+
</Component>
150+
<Component class="javax.swing.JRadioButton" name="autoFocusRadioButton">
151+
<Properties>
152+
<Property name="buttonGroup" type="javax.swing.ButtonGroup" editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor">
153+
<ComponentRef name="focusButtonGroup"/>
154+
</Property>
155+
<Property name="selected" type="boolean" value="true"/>
156+
<Property name="text" type="java.lang.String" value="auto"/>
157+
</Properties>
158+
<Events>
159+
<EventHandler event="itemStateChanged" listener="java.awt.event.ItemListener" parameters="java.awt.event.ItemEvent" handler="focusItemChanged"/>
160+
</Events>
161+
</Component>
162+
<Component class="javax.swing.JRadioButton" name="manualFocusRadioButton">
163+
<Properties>
164+
<Property name="buttonGroup" type="javax.swing.ButtonGroup" editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor">
165+
<ComponentRef name="focusButtonGroup"/>
166+
</Property>
167+
<Property name="text" type="java.lang.String" value="manual"/>
168+
<Property name="toolTipText" type="java.lang.String" value="manual setting of focus not implemented, yet"/>
169+
<Property name="enabled" type="boolean" value="false"/>
170+
</Properties>
171+
<Events>
172+
<EventHandler event="itemStateChanged" listener="java.awt.event.ItemListener" parameters="java.awt.event.ItemEvent" handler="focusItemChanged"/>
173+
</Events>
174+
</Component>
175+
<Component class="javax.swing.JSpinner" name="manualFocusSpinner">
176+
<Properties>
177+
<Property name="enabled" type="boolean" value="false"/>
178+
</Properties>
179+
<Events>
180+
<EventHandler event="stateChanged" listener="javax.swing.event.ChangeListener" parameters="javax.swing.event.ChangeEvent" handler="manualFocusSpinnerStateChanged"/>
181+
</Events>
182+
</Component>
105183
</SubComponents>
106184
</Form>

0 commit comments

Comments
 (0)