Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
U
Uploader
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
5
Issues
5
List
Boards
Labels
Service Desk
Milestones
Merge Requests
2
Merge Requests
2
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Genesys PGR
Uploader
Commits
95bfb92b
Commit
95bfb92b
authored
Jan 15, 2016
by
Matija Obreza
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Tab order improved
parent
54bac54f
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
35 additions
and
197 deletions
+35
-197
anno-gui/src/main/java/org/genesys2/anno/gui/AppWindow.java
anno-gui/src/main/java/org/genesys2/anno/gui/AppWindow.java
+20
-20
anno-gui/src/main/java/org/genesys2/anno/gui/AppWindow2.java
anno-gui/src/main/java/org/genesys2/anno/gui/AppWindow2.java
+0
-167
anno-gui/src/main/java/org/genesys2/anno/gui/DatabaseDialog.java
...i/src/main/java/org/genesys2/anno/gui/DatabaseDialog.java
+5
-6
anno-gui/src/main/java/org/genesys2/anno/gui/PushDialog.java
anno-gui/src/main/java/org/genesys2/anno/gui/PushDialog.java
+5
-2
anno-gui/src/main/java/org/genesys2/anno/gui/SettingsDialog.java
...i/src/main/java/org/genesys2/anno/gui/SettingsDialog.java
+2
-2
anno-gui/src/main/java/org/genesys2/anno/gui/WorkspaceDialog.java
.../src/main/java/org/genesys2/anno/gui/WorkspaceDialog.java
+3
-0
No files found.
anno-gui/src/main/java/org/genesys2/anno/gui/AppWindow.java
View file @
95bfb92b
...
...
@@ -585,16 +585,26 @@ public class AppWindow {
});
tltmSettings
.
setText
(
"Settings"
);
tltmSettings
.
setImage
(
settingsIcon
);
ToolItem
tltmAddFile
=
new
ToolItem
(
toolBar
,
SWT
.
NONE
);
tltmAddFile
.
addSelectionListener
(
new
SelectionAdapter
()
{
@Override
public
void
widgetSelected
(
SelectionEvent
e
)
{
addSourceFile
();
}
});
tltmAddFile
.
setText
(
"Add file"
);
tltmAddFile
.
setImage
(
openPackageIcon
);
ToolItem
tltmAddFile
=
new
ToolItem
(
toolBar
,
SWT
.
NONE
);
tltmAddFile
.
addSelectionListener
(
new
SelectionAdapter
()
{
@Override
public
void
widgetSelected
(
SelectionEvent
e
)
{
addSourceFile
();
}
});
tltmAddFile
.
setText
(
"Add file"
);
tltmAddFile
.
setImage
(
openPackageIcon
);
ToolItem
tltmDatabase
=
new
ToolItem
(
toolBar
,
SWT
.
NONE
);
tltmDatabase
.
addSelectionListener
(
new
SelectionAdapter
()
{
@Override
public
void
widgetSelected
(
SelectionEvent
e
)
{
doDatabase
();
}
});
tltmDatabase
.
setText
(
"Add database"
);
tltmDatabase
.
setImage
(
AppWindow
.
addDatabaseIcon
);
ToolItem
tltmAutomap
=
new
ToolItem
(
toolBar
,
SWT
.
NONE
);
tltmAutomap
.
addSelectionListener
(
new
SelectionAdapter
()
{
...
...
@@ -615,16 +625,6 @@ public class AppWindow {
});
tltmPush
.
setText
(
"Push"
);
tltmPush
.
setImage
(
pushDataIcon
);
ToolItem
tltmDatabase
=
new
ToolItem
(
toolBar
,
SWT
.
NONE
);
tltmDatabase
.
addSelectionListener
(
new
SelectionAdapter
()
{
@Override
public
void
widgetSelected
(
SelectionEvent
e
)
{
doDatabase
();
}
});
tltmDatabase
.
setText
(
"Add database"
);
tltmDatabase
.
setImage
(
AppWindow
.
addDatabaseIcon
);
m_bindingContext
=
initDataBindings
();
}
...
...
anno-gui/src/main/java/org/genesys2/anno/gui/AppWindow2.java
deleted
100644 → 0
View file @
54bac54f
/**
* Copyright 2014 Global Crop Diversity Trust
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
**/
package
org.genesys2.anno.gui
;
import
org.eclipse.swt.SWT
;
import
org.eclipse.swt.custom.SashForm
;
import
org.eclipse.swt.events.SelectionAdapter
;
import
org.eclipse.swt.events.SelectionEvent
;
import
org.eclipse.swt.graphics.Point
;
import
org.eclipse.swt.widgets.Display
;
import
org.eclipse.swt.widgets.Menu
;
import
org.eclipse.swt.widgets.MenuItem
;
import
org.eclipse.swt.widgets.Shell
;
import
org.eclipse.swt.widgets.Table
;
import
org.eclipse.swt.widgets.TableColumn
;
import
org.eclipse.swt.widgets.Tree
;
import
org.eclipse.swt.widgets.TreeColumn
;
import
org.eclipse.swt.widgets.TreeItem
;
import
swing2swt.layout.BorderLayout
;
public
class
AppWindow2
{
protected
Shell
shlGenesysMagic
;
private
MenuItem
mntmQuit
;
private
Table
table
;
/**
* Launch the application.
*
* @param args
*/
public
static
void
main
(
String
[]
args
)
{
try
{
AppWindow2
window
=
new
AppWindow2
();
window
.
open
();
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
/**
* Open the window.
*/
public
void
open
()
{
Display
display
=
Display
.
getDefault
();
createContents
();
shlGenesysMagic
.
open
();
shlGenesysMagic
.
layout
();
while
(!
shlGenesysMagic
.
isDisposed
())
{
if
(!
display
.
readAndDispatch
())
{
display
.
sleep
();
}
}
}
public
static
boolean
isMac
()
{
if
(
System
.
getProperty
(
"os.name"
).
equals
(
"Mac OS X"
))
{
return
true
;
}
return
false
;
}
/**
* Create contents of the window.
*/
protected
void
createContents
()
{
shlGenesysMagic
=
new
Shell
();
shlGenesysMagic
.
setMinimumSize
(
new
Point
(
100
,
22
));
shlGenesysMagic
.
setSize
(
554
,
374
);
shlGenesysMagic
.
setText
(
"Genesys Magic"
);
shlGenesysMagic
.
setLayout
(
new
BorderLayout
(
5
,
5
));
Menu
menu
=
new
Menu
(
shlGenesysMagic
,
SWT
.
BAR
);
shlGenesysMagic
.
setMenuBar
(
menu
);
MenuItem
mntmFile
=
new
MenuItem
(
menu
,
SWT
.
CASCADE
);
mntmFile
.
setText
(
"File"
);
Menu
menu_1
=
new
Menu
(
mntmFile
);
mntmFile
.
setMenu
(
menu_1
);
MenuItem
mntmOpen
=
new
MenuItem
(
menu_1
,
SWT
.
NONE
);
mntmOpen
.
setText
(
"Open"
);
new
MenuItem
(
menu_1
,
SWT
.
SEPARATOR
);
mntmQuit
=
new
MenuItem
(
menu_1
,
SWT
.
NONE
);
mntmQuit
.
addSelectionListener
(
new
SelectionAdapter
()
{
@Override
public
void
widgetSelected
(
SelectionEvent
arg0
)
{
System
.
err
.
println
(
"Exiting now."
);
shlGenesysMagic
.
dispose
();
}
});
mntmQuit
.
setText
(
"Quit"
);
MenuItem
mntmHelp
=
new
MenuItem
(
menu
,
SWT
.
CASCADE
);
mntmHelp
.
setText
(
"Help"
);
Menu
menu_2
=
new
Menu
(
mntmHelp
);
mntmHelp
.
setMenu
(
menu_2
);
MenuItem
mntmAbout
=
new
MenuItem
(
menu_2
,
SWT
.
NONE
);
mntmAbout
.
setText
(
"About"
);
new
MenuItem
(
menu_2
,
SWT
.
SEPARATOR
);
MenuItem
mntmVersion
=
new
MenuItem
(
menu_2
,
SWT
.
NONE
);
mntmVersion
.
setText
(
"Version..."
);
SashForm
sashForm
=
new
SashForm
(
shlGenesysMagic
,
SWT
.
NONE
);
sashForm
.
setLayoutData
(
BorderLayout
.
CENTER
);
table
=
new
Table
(
sashForm
,
SWT
.
BORDER
|
SWT
.
FULL_SELECTION
);
table
.
setHeaderVisible
(
true
);
table
.
setLinesVisible
(
true
);
TableColumn
tblclmnColumn
=
new
TableColumn
(
table
,
SWT
.
NONE
);
tblclmnColumn
.
setWidth
(
100
);
tblclmnColumn
.
setText
(
"Column"
);
TableColumn
tblclmnRdfTerm
=
new
TableColumn
(
table
,
SWT
.
NONE
);
tblclmnRdfTerm
.
setWidth
(
200
);
tblclmnRdfTerm
.
setText
(
"Ontology Term"
);
Tree
tree
=
new
Tree
(
sashForm
,
SWT
.
BORDER
|
SWT
.
FULL_SELECTION
);
tree
.
setLinesVisible
(
true
);
tree
.
setHeaderVisible
(
true
);
TreeColumn
trclmnTerms
=
new
TreeColumn
(
tree
,
SWT
.
NONE
);
trclmnTerms
.
setWidth
(
200
);
trclmnTerms
.
setText
(
"Terms"
);
TreeColumn
trclmnUrl
=
new
TreeColumn
(
tree
,
SWT
.
NONE
);
trclmnUrl
.
setWidth
(
100
);
trclmnUrl
.
setText
(
"URL"
);
TreeItem
trtmSomeTree
=
new
TreeItem
(
tree
,
SWT
.
NONE
);
trtmSomeTree
.
setChecked
(
true
);
trtmSomeTree
.
setText
(
"Some tree"
);
trtmSomeTree
.
setExpanded
(
true
);
TreeItem
trtmNewTreeitem_1
=
new
TreeItem
(
tree
,
SWT
.
NONE
);
trtmNewTreeitem_1
.
setText
(
"Bugger"
);
TreeItem
trtmNewTreeitem
=
new
TreeItem
(
tree
,
SWT
.
NONE
);
trtmNewTreeitem
.
setText
(
new
String
[]
{
"Alpha"
,
"beta"
});
trtmNewTreeitem
.
setText
(
"Another treee"
);
sashForm
.
setWeights
(
new
int
[]
{
310
,
239
});
}
}
anno-gui/src/main/java/org/genesys2/anno/gui/DatabaseDialog.java
View file @
95bfb92b
...
...
@@ -103,7 +103,7 @@ public class DatabaseDialog extends Dialog {
*/
private
void
createContents
()
{
shell
=
new
Shell
(
getParent
(),
SWT
.
SHELL_TRIM
);
shell
.
setSize
(
6
65
,
445
);
shell
.
setSize
(
6
74
,
281
);
shell
.
setText
(
getText
());
shell
.
setLayout
(
new
BorderLayout
(
0
,
0
));
...
...
@@ -121,7 +121,7 @@ public class DatabaseDialog extends Dialog {
/* Datasource type */
Label
lblType
=
new
Label
(
grpDbConfiguration
,
SWT
.
NONE
);
lblType
.
setLayoutData
(
new
GridData
(
SWT
.
FILL
,
SWT
.
CENTER
,
false
,
false
,
1
,
1
));
lblType
.
setText
(
"Data
sourc
e type"
);
lblType
.
setText
(
"Data
bas
e type"
);
comboType
=
new
Combo
(
grpDbConfiguration
,
SWT
.
NONE
);
comboType
.
setItems
(
getDriversNames
(
drivers
.
getJdbcDrivers
()));
...
...
@@ -149,7 +149,7 @@ public class DatabaseDialog extends Dialog {
Label
lblDbUrl
=
new
Label
(
grpDbConfiguration
,
SWT
.
NONE
);
lblDbUrl
.
setLayoutData
(
new
GridData
(
SWT
.
FILL
,
SWT
.
CENTER
,
false
,
false
,
1
,
1
));
lblDbUrl
.
setAlignment
(
SWT
.
RIGHT
);
lblDbUrl
.
setText
(
"Connection URL"
);
lblDbUrl
.
setText
(
"
JDBC
Connection URL"
);
txtDbUrl
=
new
Text
(
grpDbConfiguration
,
SWT
.
BORDER
);
txtDbUrl
.
setLayoutData
(
new
GridData
(
SWT
.
FILL
,
SWT
.
CENTER
,
true
,
false
,
1
,
1
));
...
...
@@ -157,7 +157,7 @@ public class DatabaseDialog extends Dialog {
Label
lblDbUserName
=
new
Label
(
grpDbConfiguration
,
SWT
.
NONE
);
lblDbUserName
.
setAlignment
(
SWT
.
RIGHT
);
lblDbUserName
.
setLayoutData
(
new
GridData
(
SWT
.
RIGHT
,
SWT
.
CENTER
,
false
,
false
,
1
,
1
));
lblDbUserName
.
setText
(
"User"
);
lblDbUserName
.
setText
(
"User
name
"
);
txtDbUserName
=
new
Text
(
grpDbConfiguration
,
SWT
.
BORDER
);
txtDbUserName
.
setLayoutData
(
new
GridData
(
SWT
.
FILL
,
SWT
.
CENTER
,
true
,
false
,
1
,
1
));
...
...
@@ -171,8 +171,7 @@ public class DatabaseDialog extends Dialog {
txtDbPassword
.
setLayoutData
(
new
GridData
(
SWT
.
FILL
,
SWT
.
CENTER
,
true
,
false
,
1
,
1
));
Composite
compositeFooter
=
new
Composite
(
composite
,
SWT
.
NONE
);
GridData
gdFooter
=
new
GridData
(
SWT
.
CENTER
,
SWT
.
TOP
,
true
,
false
,
1
,
1
);
compositeFooter
.
setLayoutData
(
gdFooter
);
compositeFooter
.
setLayoutData
(
new
GridData
(
SWT
.
CENTER
,
SWT
.
TOP
,
true
,
false
,
1
,
1
));
compositeFooter
.
setLayout
(
new
RowLayout
(
SWT
.
HORIZONTAL
));
Button
btnDownloadFile
=
new
Button
(
compositeFooter
,
SWT
.
NONE
);
...
...
anno-gui/src/main/java/org/genesys2/anno/gui/PushDialog.java
View file @
95bfb92b
...
...
@@ -51,6 +51,7 @@ import com.fasterxml.jackson.databind.ObjectMapper;
import
com.fasterxml.jackson.databind.node.ObjectNode
;
import
swing2swt.layout.BorderLayout
;
import
org.eclipse.swt.widgets.Control
;
public
class
PushDialog
extends
Dialog
{
private
static
final
Logger
_log
=
Logger
.
getLogger
(
PushDialog
.
class
);
...
...
@@ -84,6 +85,7 @@ public class PushDialog extends Dialog {
private
SwtLogAppender
logAppender
;
private
IDataSource
dataSource
;
private
List
<
Future
<?>>
futures
=
new
ArrayList
<
Future
<?>>();
private
ToolBar
toolBar
;
static
{
deleteDataIcon
=
ImageDescriptor
.
createFromURL
(
PushDialog
.
class
.
getResource
(
"/icon/delete.png"
)).
createImage
();
...
...
@@ -115,6 +117,7 @@ public class PushDialog extends Dialog {
createContents
();
logAppender
=
new
SwtLogAppender
(
this
.
txtJson
);
shell
.
setTabList
(
new
Control
[]{
txtJson
,
toolBar
});
logAppender
.
setConversionPattern
(
"%d{yyyy-MM-dd HH:mm:ss} %-5p - %m%n"
);
shell
.
open
();
...
...
@@ -168,7 +171,7 @@ public class PushDialog extends Dialog {
shell
.
setText
(
getText
());
shell
.
setLayout
(
new
BorderLayout
(
0
,
0
));
ToolBar
toolBar
=
new
ToolBar
(
shell
,
SWT
.
FLAT
);
toolBar
=
new
ToolBar
(
shell
,
SWT
.
FLAT
);
toolBar
.
setLayoutData
(
BorderLayout
.
NORTH
);
ToolItem
tltmNewItem
=
new
ToolItem
(
toolBar
,
SWT
.
NONE
);
...
...
@@ -221,10 +224,10 @@ public class PushDialog extends Dialog {
logAppender
.
setThreshold
(
Level
.
DEBUG
);
}
});
tltmRadioItemDebug
.
setSelection
(
true
);
tltmRadioItemDebug
.
setText
(
"DEBUG"
);
ToolItem
tltmRadioItemInfo
=
new
ToolItem
(
toolBar
,
SWT
.
RADIO
);
tltmRadioItemInfo
.
setSelection
(
true
);
tltmRadioItemInfo
.
addSelectionListener
(
new
SelectionAdapter
()
{
@Override
public
void
widgetSelected
(
SelectionEvent
e
)
{
...
...
anno-gui/src/main/java/org/genesys2/anno/gui/SettingsDialog.java
View file @
95bfb92b
...
...
@@ -231,8 +231,8 @@ public class SettingsDialog extends Dialog {
scrolledComposite
.
setContent
(
composite
);
scrolledComposite
.
setMinSize
(
composite
.
computeSize
(
SWT
.
DEFAULT
,
SWT
.
DEFAULT
));
TabItem
tbtmTodo
=
new
TabItem
(
tabFolder
,
SWT
.
NONE
);
tbtmTodo
.
setText
(
"TODO"
);
//
TabItem tbtmTodo = new TabItem(tabFolder, SWT.NONE);
//
tbtmTodo.setText("TODO");
m_bindingContext
=
initDataBindings
();
}
...
...
anno-gui/src/main/java/org/genesys2/anno/gui/WorkspaceDialog.java
View file @
95bfb92b
...
...
@@ -23,6 +23,7 @@ import org.eclipse.swt.widgets.Text;
import
org.eclipse.wb.swt.SWTResourceManager
;
import
swing2swt.layout.BorderLayout
;
import
org.eclipse.swt.widgets.Control
;
public
class
WorkspaceDialog
extends
Dialog
{
...
...
@@ -122,6 +123,7 @@ public class WorkspaceDialog extends Dialog {
lblWorkspaceError
.
setText
(
"Cannot use selected directory as workspace!"
);
lblWorkspaceError
.
setVisible
(
false
);
new
Label
(
composite
,
SWT
.
NONE
);
composite
.
setTabList
(
new
Control
[]{
btnBrowse
,
txtWorkspacePath
});
Composite
composite_1
=
new
Composite
(
shlWorkspaceLauncher
,
SWT
.
NONE
);
composite_1
.
setLayoutData
(
BorderLayout
.
SOUTH
);
...
...
@@ -149,6 +151,7 @@ public class WorkspaceDialog extends Dialog {
}
});
btnOk
.
setText
(
"OK"
);
composite_1
.
setTabList
(
new
Control
[]{
btnOk
,
btnCancel
});
Composite
composite_2
=
new
Composite
(
shlWorkspaceLauncher
,
SWT
.
NONE
);
composite_2
.
setBackground
(
SWTResourceManager
.
getColor
(
SWT
.
COLOR_TITLE_INACTIVE_BACKGROUND
));
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment