add a split pane, rename buttons, placeholders for results and downloads
This commit is contained in:
@@ -7,6 +7,7 @@ import griffon.metadata.ArtifactProviderFor
|
||||
import javax.swing.BorderFactory
|
||||
import javax.swing.Box
|
||||
import javax.swing.BoxLayout
|
||||
import javax.swing.JSplitPane
|
||||
import javax.swing.SwingConstants
|
||||
import javax.swing.border.Border
|
||||
|
||||
@@ -29,20 +30,20 @@ class MainFrameView {
|
||||
void initUI() {
|
||||
builder.with {
|
||||
application(size : [1024,768], id: 'main-frame',
|
||||
title: application.configuration['application.title'],
|
||||
iconImage: imageIcon('/griffon-icon-48x48.png').image,
|
||||
iconImages: [imageIcon('/griffon-icon-48x48.png').image,
|
||||
imageIcon('/griffon-icon-32x32.png').image,
|
||||
imageIcon('/griffon-icon-16x16.png').image],
|
||||
pack : false,
|
||||
visible : bind { model.coreInitialized }) {
|
||||
title: application.configuration['application.title'],
|
||||
iconImage: imageIcon('/griffon-icon-48x48.png').image,
|
||||
iconImages: [imageIcon('/griffon-icon-48x48.png').image,
|
||||
imageIcon('/griffon-icon-32x32.png').image,
|
||||
imageIcon('/griffon-icon-16x16.png').image],
|
||||
pack : false,
|
||||
visible : bind { model.coreInitialized }) {
|
||||
borderLayout()
|
||||
panel (border: etchedBorder(), constraints : BorderLayout.NORTH) {
|
||||
borderLayout()
|
||||
panel (constraints: BorderLayout.WEST) {
|
||||
gridLayout(rows:1, cols: 2)
|
||||
button(text: "1", actionPerformed : showCard1)
|
||||
button(text: "2", actionPerformed : showCard2)
|
||||
button(text: "Searches", actionPerformed : showSearchWindow)
|
||||
button(text: "Uploads", actionPerformed : showUploadsWindow)
|
||||
}
|
||||
panel(constraints: BorderLayout.CENTER) {
|
||||
borderLayout()
|
||||
@@ -55,27 +56,43 @@ class MainFrameView {
|
||||
}
|
||||
panel (id: "cards-panel", constraints : BorderLayout.CENTER) {
|
||||
cardLayout()
|
||||
panel (constraints : "card1") {
|
||||
label("card 1")
|
||||
panel (constraints : "search window") {
|
||||
borderLayout()
|
||||
splitPane( orientation : JSplitPane.VERTICAL_SPLIT, dividerLocation : -1,
|
||||
continuousLayout : true, constraints : BorderLayout.CENTER) {
|
||||
panel (constraints : JSplitPane.TOP, preferredSize : [1020, 500]) {
|
||||
borderLayout()
|
||||
label(text : "results go here", constraints : BorderLayout.CENTER)
|
||||
panel(constraints : BorderLayout.SOUTH) {
|
||||
button(text : "Download")
|
||||
button(text : "Trust")
|
||||
button(text : "Distrust")
|
||||
}
|
||||
}
|
||||
panel (constraints : JSplitPane.BOTTOM) {
|
||||
borderLayout()
|
||||
label(text : "downloads go here", constraints : BorderLayout.CENTER)
|
||||
}
|
||||
}
|
||||
}
|
||||
panel (constraints: "card2"){
|
||||
panel (constraints: "uploads window"){
|
||||
label("card 2")
|
||||
}
|
||||
}
|
||||
panel (border: etchedBorder(), constraints : BorderLayout.SOUTH) {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
def showCard1 = {
|
||||
|
||||
def showSearchWindow = {
|
||||
def cardsPanel = builder.getVariable("cards-panel")
|
||||
cardsPanel.getLayout().show(cardsPanel, "card1")
|
||||
cardsPanel.getLayout().show(cardsPanel, "search window")
|
||||
}
|
||||
|
||||
def showCard2 = {
|
||||
|
||||
def showUploadsWindow = {
|
||||
def cardsPanel = builder.getVariable("cards-panel")
|
||||
cardsPanel.getLayout().show(cardsPanel, "card2")
|
||||
cardsPanel.getLayout().show(cardsPanel, "uploads window")
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user