forked from fanruan/design
alex.sung
6 years ago
21 changed files with 431 additions and 32 deletions
@ -0,0 +1,41 @@
|
||||
package com.fr.design.actions.community; |
||||
|
||||
import com.fr.design.menu.MenuKeySet; |
||||
import com.fr.design.utils.BrowseUtils; |
||||
import com.fr.general.CloudCenter; |
||||
import com.fr.general.IOUtils; |
||||
|
||||
import javax.swing.KeyStroke; |
||||
import java.awt.event.ActionEvent; |
||||
|
||||
public class FacebookFansAction extends UpAction { |
||||
|
||||
public FacebookFansAction() { |
||||
this.setMenuKeySet(FACEBOOKFANS); |
||||
this.setName(getMenuKeySet().getMenuName()); |
||||
this.setMnemonic(getMenuKeySet().getMnemonic()); |
||||
this.setSmallIcon(IOUtils.readIcon("/com/fr/design/images/bbs/facebook.png")); |
||||
} |
||||
|
||||
@Override |
||||
public void actionPerformed(ActionEvent arg0) { |
||||
BrowseUtils.browser(CloudCenter.getInstance().acquireUrlByKind("facebook.fans.tw")); |
||||
} |
||||
|
||||
public static final MenuKeySet FACEBOOKFANS = new MenuKeySet() { |
||||
@Override |
||||
public char getMnemonic() { |
||||
return 'F'; |
||||
} |
||||
|
||||
@Override |
||||
public String getMenuName() { |
||||
return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Community_FaceBook_Fans"); |
||||
} |
||||
|
||||
@Override |
||||
public KeyStroke getKeyStroke() { |
||||
return null; |
||||
} |
||||
}; |
||||
} |
@ -0,0 +1,37 @@
|
||||
package com.fr.design.mainframe.vcs.ui; |
||||
|
||||
import com.fr.design.editor.editor.DateEditor; |
||||
import com.fr.log.FineLoggerFactory; |
||||
|
||||
import java.text.ParseException; |
||||
import java.util.Date; |
||||
|
||||
/** |
||||
* Created by XiaXiang on 2019/5/14. |
||||
*/ |
||||
public class VcsDateEditor extends DateEditor { |
||||
private Date tempValue; |
||||
|
||||
public VcsDateEditor(Date value, boolean format, String name, int dateFormat) { |
||||
super(value, format, name, dateFormat); |
||||
this.tempValue = value; |
||||
} |
||||
|
||||
@Override |
||||
public Date getValue() { |
||||
if (tempValue == null) { |
||||
return null; |
||||
} |
||||
return super.getValue(); |
||||
} |
||||
|
||||
@Override |
||||
public void setValue(Date value) { |
||||
this.tempValue = value; |
||||
try { |
||||
getUiDatePicker().setSelectedDate(value); |
||||
} catch (ParseException parseException) { |
||||
FineLoggerFactory.getLogger().error(parseException.getMessage(), parseException); |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,32 @@
|
||||
package com.fr.design.mainframe.vcs.ui; |
||||
|
||||
|
||||
import com.fr.design.gui.ilable.ActionLabel; |
||||
import com.fr.design.gui.ilable.UILabel; |
||||
|
||||
import java.awt.Color; |
||||
import java.awt.Graphics; |
||||
|
||||
/** |
||||
* Created by XiaXiang on 2019/5/15. |
||||
*/ |
||||
public class VcsLabel extends ActionLabel { |
||||
|
||||
|
||||
public VcsLabel(String text, Color color) { |
||||
super(text); |
||||
this.setForeground(color); |
||||
} |
||||
|
||||
public void paintComponent(Graphics g) { |
||||
if (ui != null) { |
||||
Graphics scratchGraphics = (g == null) ? null : g.create(); |
||||
try { |
||||
ui.update(scratchGraphics, this); |
||||
} |
||||
finally { |
||||
scratchGraphics.dispose(); |
||||
} |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,39 @@
|
||||
package com.fr.design.upm.database; |
||||
|
||||
import com.fr.web.struct.AssembleComponent; |
||||
import com.fr.web.struct.Atom; |
||||
import com.fr.web.struct.browser.RequestClient; |
||||
import com.fr.web.struct.category.ScriptPath; |
||||
import com.fr.web.struct.category.StylePath; |
||||
import com.fr.web.struct.impl.FineUI; |
||||
|
||||
/** |
||||
* @author richie |
||||
* @version 10.0 |
||||
* Created by richie on 2019-05-16 |
||||
*/ |
||||
public class UniverseDatabaseComponent extends AssembleComponent { |
||||
|
||||
public static final UniverseDatabaseComponent KEY = new UniverseDatabaseComponent(); |
||||
|
||||
private UniverseDatabaseComponent() { |
||||
|
||||
} |
||||
|
||||
@Override |
||||
public ScriptPath script(RequestClient req) { |
||||
return ScriptPath.build("/com/fr/design/upm/database/database.js"); |
||||
} |
||||
|
||||
@Override |
||||
public StylePath style(RequestClient req) { |
||||
return StylePath.EMPTY; |
||||
} |
||||
|
||||
@Override |
||||
public Atom[] refer() { |
||||
return new Atom[]{ |
||||
FineUI.KEY |
||||
}; |
||||
} |
||||
} |
@ -0,0 +1,32 @@
|
||||
package com.fr.design.upm.database; |
||||
|
||||
import com.fr.design.dialog.BasicPane; |
||||
import com.fr.design.dialog.UIDialog; |
||||
import com.fr.design.utils.gui.GUICoreUtils; |
||||
|
||||
import javax.swing.*; |
||||
import java.awt.*; |
||||
|
||||
/** |
||||
* @author richie |
||||
* @version 10.0 |
||||
* Created by richie on 2019-05-16 |
||||
*/ |
||||
public class UniverseDatabaseDialog extends UIDialog { |
||||
|
||||
public UniverseDatabaseDialog(Frame frame, BasicPane pane) { |
||||
super(frame); |
||||
setUndecorated(true); |
||||
JPanel panel = (JPanel) getContentPane(); |
||||
panel.setLayout(new BorderLayout()); |
||||
add(pane, BorderLayout.CENTER); |
||||
setSize(new Dimension(800, 500)); |
||||
GUICoreUtils.centerWindow(this); |
||||
setResizable(false); |
||||
} |
||||
|
||||
@Override |
||||
public void checkValid() throws Exception { |
||||
|
||||
} |
||||
} |
@ -0,0 +1,36 @@
|
||||
package com.fr.design.upm.database; |
||||
|
||||
import com.fr.design.dialog.UIDialog; |
||||
import com.fr.design.mainframe.DesignerContext; |
||||
|
||||
import javax.swing.*; |
||||
|
||||
/** |
||||
* @author richie |
||||
* @version 10.0 |
||||
* Created by richie on 2019-05-16 |
||||
*/ |
||||
public class UniverseDatabaseOpener { |
||||
|
||||
private static UIDialog dialog = null; |
||||
|
||||
public static UIDialog getDialog() { |
||||
return dialog; |
||||
} |
||||
|
||||
public static void showUniverseDatabaseDialog() { |
||||
UniverseDatabasePane upmPane = new UniverseDatabasePane(); |
||||
if (dialog == null) { |
||||
dialog = new UniverseDatabaseDialog(DesignerContext.getDesignerFrame(), upmPane); |
||||
} |
||||
dialog.setVisible(true); |
||||
} |
||||
|
||||
public static void closeWindow() { |
||||
if (dialog != null) { |
||||
dialog.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); |
||||
dialog.setVisible(false); |
||||
dialog = null; |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,38 @@
|
||||
package com.fr.design.upm.database; |
||||
|
||||
import com.fr.design.dialog.BasicPane; |
||||
import com.fr.design.ui.ModernUIPane; |
||||
import com.teamdev.jxbrowser.chromium.JSValue; |
||||
import com.teamdev.jxbrowser.chromium.events.ScriptContextAdapter; |
||||
import com.teamdev.jxbrowser.chromium.events.ScriptContextEvent; |
||||
|
||||
import java.awt.*; |
||||
|
||||
/** |
||||
* @author richie |
||||
* @version 10.0 |
||||
* Created by richie on 2019-05-16 |
||||
*/ |
||||
public class UniverseDatabasePane extends BasicPane { |
||||
|
||||
private ModernUIPane<Object> modernUIPane; |
||||
|
||||
@Override |
||||
protected String title4PopupWindow() { |
||||
return "Database"; |
||||
} |
||||
|
||||
public UniverseDatabasePane() { |
||||
setLayout(new BorderLayout()); |
||||
modernUIPane = new ModernUIPane.Builder<Object>() |
||||
.withComponent(UniverseDatabaseComponent.KEY) |
||||
.prepare(new ScriptContextAdapter() { |
||||
@Override |
||||
public void onScriptContextCreated(ScriptContextEvent event) { |
||||
JSValue window = event.getBrowser().executeJavaScriptAndReturnValue("window"); |
||||
} |
||||
}) |
||||
.build(); |
||||
add(modernUIPane, BorderLayout.CENTER); |
||||
} |
||||
} |
After Width: | Height: | Size: 484 B |
@ -0,0 +1,57 @@
|
||||
window.addEventListener("load", function (ev) { |
||||
var combo1 = BI.createWidget({ |
||||
type: "bi.vertical", |
||||
items: [ |
||||
{ |
||||
type: "bi.text_value_combo", |
||||
text: "选项1", |
||||
width: 300, |
||||
items: [ |
||||
{ |
||||
el: { |
||||
type: "bi.single_select_radio_item", |
||||
width: 290, |
||||
text: "选项1", |
||||
value: 1 |
||||
}, |
||||
text: "选项1", |
||||
value: 1, |
||||
lgap: 10 |
||||
}, |
||||
{ |
||||
el: { |
||||
type: "bi.single_select_radio_item", |
||||
width: 290, |
||||
text: "选项2", |
||||
value: 2 |
||||
}, |
||||
lgap: 10, |
||||
text: "选项2", |
||||
value: 2 |
||||
}, |
||||
{ |
||||
el: { |
||||
type: "bi.single_select_radio_item", |
||||
width: 290, |
||||
text: "选项3", |
||||
value: 3 |
||||
}, |
||||
lgap: 10, |
||||
text: "选项3", |
||||
value: 3 |
||||
} |
||||
] |
||||
} |
||||
] |
||||
}); |
||||
|
||||
BI.createWidget({ |
||||
type:"bi.absolute", |
||||
element: "body", |
||||
items: [{ |
||||
el: combo1, |
||||
left: 100, |
||||
top: 100 |
||||
}] |
||||
}); |
||||
}); |
Loading…
Reference in new issue