getType() {
320 | return Resource.class;
321 | }
322 | });
323 |
324 | return gpc;
325 | }
326 |
327 |
328 | public static void main(String[] args) {
329 |
330 | @NotNull DecimalFormat df = new DecimalFormat();
331 | df.setGroupingUsed(false);
332 | System.out.println(df.format(100000));
333 | }
334 |
335 | }
336 |
337 |
--------------------------------------------------------------------------------
/src/main/java/net/openhft/chronicle/engine/gui/EntryPoint.java:
--------------------------------------------------------------------------------
1 | package net.openhft.chronicle.engine.gui;
2 |
3 | import com.vaadin.annotations.Theme;
4 | import com.vaadin.annotations.VaadinServletConfiguration;
5 | import com.vaadin.navigator.Navigator;
6 | import com.vaadin.navigator.View;
7 | import com.vaadin.navigator.ViewChangeListener;
8 | import com.vaadin.server.VaadinRequest;
9 | import com.vaadin.server.VaadinServlet;
10 | import com.vaadin.ui.Component;
11 | import com.vaadin.ui.Notification;
12 | import com.vaadin.ui.UI;
13 | import com.vaadin.ui.VerticalLayout;
14 | import net.openhft.chronicle.engine.tree.VanillaAssetTree;
15 | import net.openhft.chronicle.network.VanillaSessionDetails;
16 | import net.openhft.chronicle.network.connection.ClientConnectionMonitor;
17 | import net.openhft.chronicle.network.connection.FatalFailureConnectionStrategy;
18 | import org.jetbrains.annotations.NotNull;
19 |
20 | import javax.servlet.annotation.WebServlet;
21 |
22 | import static net.openhft.chronicle.wire.WireType.BINARY;
23 |
24 |
25 | /**
26 | * This UI is the application entry point. A UI may either represent a browser window
27 | * (or tab) or some part of a html page where a Vaadin application is embedded.
28 | *
29 | * The UI is initialized using {@link #init(VaadinRequest)}. This method is intended to be
30 | * overridden to add component to the user interface and initialize non-component functionality.
31 | */
32 | @SuppressWarnings("WeakerAccess")
33 | @Theme("mytheme")
34 | public class EntryPoint extends UI {
35 |
36 | Navigator navigator;
37 | protected static final String MAINVIEW = "main";
38 |
39 |
40 | public static class LoginView extends VerticalLayout implements View {
41 | Login c;
42 |
43 | public LoginView(Navigator navigator) {
44 | c = new Login(navigator, "Welcome to chronicle-engine, Please login :");
45 | addComponent(c);
46 | }
47 |
48 | @Override
49 | public void enter(ViewChangeListener.ViewChangeEvent event) {
50 | Notification.show("Please Login");
51 | c.enter(event);
52 | }
53 | }
54 |
55 |
56 | public class MainView extends VerticalLayout implements View {
57 |
58 |
59 | @Override
60 | public void enter(ViewChangeListener.ViewChangeEvent event) {
61 | removeAllComponents();
62 | @NotNull VanillaAssetTree tree = (VanillaAssetTree) getSession().getAttribute("tree");
63 | if (tree == null) {
64 | navigator.navigateTo("");
65 | return;
66 | }
67 | @NotNull Component c = new MainControl().newComponent(tree);
68 | addComponent(c);
69 | setSizeFull();
70 |
71 | }
72 | }
73 |
74 | @Override
75 | protected void init(VaadinRequest vaadinRequest) {
76 | getPage().setTitle("Chronicle Engine");
77 | // Create a navigator to control the views
78 | navigator = new Navigator(this, this);
79 |
80 | navigator.addView("", new LoginView(navigator));
81 | navigator.addView(MAINVIEW, new MainView());
82 | }
83 |
84 | @WebServlet(urlPatterns = "/*", name = "MyUIServlet", asyncSupported = true)
85 | @VaadinServletConfiguration(ui = EntryPoint.class, productionMode = false)
86 | public static class MyUIServlet extends VaadinServlet {
87 |
88 | }
89 |
90 | static VanillaAssetTree remote(final String connectionDetails) {
91 | return new VanillaAssetTree().forRemoteAccess(connectionDetails);
92 | }
93 |
94 | @NotNull
95 | static VanillaAssetTree remote(@NotNull final String connectionDetails,
96 | @NotNull VanillaSessionDetails sessionDetails,
97 | @NotNull ClientConnectionMonitor cm) {
98 | @NotNull final VanillaAssetTree tree = new VanillaAssetTree();
99 | tree.root().forRemoteAccess(new String[]{connectionDetails}, BINARY, sessionDetails, cm, new FatalFailureConnectionStrategy(3));
100 | return tree;
101 | }
102 |
103 | }
104 |
--------------------------------------------------------------------------------
/src/main/java/net/openhft/chronicle/engine/gui/KeyValueResultSetMetaData.java:
--------------------------------------------------------------------------------
1 | package net.openhft.chronicle.engine.gui;
2 |
3 | import net.openhft.chronicle.engine.api.column.Column;
4 | import org.jetbrains.annotations.NotNull;
5 |
6 | import java.sql.ResultSetMetaData;
7 | import java.sql.SQLException;
8 | import java.util.List;
9 |
10 | /**
11 | * @author Rob Austin.
12 | */
13 | class KeyValueResultSetMetaData implements ResultSetMetaData {
14 |
15 | @NotNull
16 | private final List columns;
17 |
18 | KeyValueResultSetMetaData(@NotNull List columns) {
19 | this.columns = columns;
20 | }
21 |
22 | @Override
23 | public int getColumnCount() throws SQLException {
24 | return columns.size();
25 | }
26 |
27 | @Override
28 | public boolean isAutoIncrement(int column) throws SQLException {
29 | return false;
30 | }
31 |
32 | @Override
33 | public boolean isCaseSensitive(int column) throws SQLException {
34 | throw new UnsupportedOperationException("todo");
35 | }
36 |
37 | @Override
38 | public boolean isSearchable(int column) throws SQLException {
39 | throw new UnsupportedOperationException("todo");
40 | }
41 |
42 | @Override
43 | public boolean isCurrency(int column) throws SQLException {
44 | throw new UnsupportedOperationException("todo");
45 | }
46 |
47 | @Override
48 | public int isNullable(int column) throws SQLException {
49 | return 0;
50 | }
51 |
52 | @Override
53 | public boolean isSigned(int column) throws SQLException {
54 | throw new UnsupportedOperationException("todo");
55 | }
56 |
57 | @Override
58 | public int getColumnDisplaySize(int column) throws SQLException {
59 | throw new UnsupportedOperationException("todo");
60 | }
61 |
62 | @Override
63 | public String getColumnLabel(int column) throws SQLException {
64 | return columns.get(column - 1).name;
65 | }
66 |
67 | @Override
68 | public String getColumnName(int column) throws SQLException {
69 | return columns.get(column - 1).name;
70 | }
71 |
72 | @NotNull
73 | @Override
74 | public String getSchemaName(int column) throws SQLException {
75 | throw new UnsupportedOperationException("todo");
76 | }
77 |
78 | @Override
79 | public int getPrecision(int column) throws SQLException {
80 | throw new UnsupportedOperationException("todo");
81 | }
82 |
83 | @Override
84 | public int getScale(int column) throws SQLException {
85 | throw new UnsupportedOperationException("todo");
86 | }
87 |
88 | @NotNull
89 | @Override
90 | public String getTableName(int column) throws SQLException {
91 | throw new UnsupportedOperationException("todo");
92 | }
93 |
94 | @NotNull
95 | @Override
96 | public String getCatalogName(int column) throws SQLException {
97 | throw new UnsupportedOperationException("todo");
98 | }
99 |
100 | @Override
101 | public int getColumnType(int column) throws SQLException {
102 | throw new UnsupportedOperationException("todo");
103 | }
104 |
105 | @NotNull
106 | @Override
107 | public String getColumnTypeName(int column) throws SQLException {
108 | return columns.get(column - 1).type().getSimpleName();
109 | }
110 |
111 | @Override
112 | public boolean isReadOnly(int column) throws SQLException {
113 | return columns.get(column - 1).isReadOnly();
114 | }
115 |
116 | @Override
117 | public boolean isWritable(int column) throws SQLException {
118 | return !columns.get(column - 1).isReadOnly();
119 | }
120 |
121 | @Override
122 | public boolean isDefinitelyWritable(int column) throws SQLException {
123 | throw new UnsupportedOperationException("todo");
124 | }
125 |
126 | @NotNull
127 | @Override
128 | public String getColumnClassName(int column) throws SQLException {
129 | return "java.lang.String";
130 | }
131 |
132 | @NotNull
133 | @Override
134 | public T unwrap(Class iface) throws SQLException {
135 | throw new UnsupportedOperationException("todo");
136 | }
137 |
138 | @Override
139 | public boolean isWrapperFor(Class> iface) throws SQLException {
140 | throw new UnsupportedOperationException("todo");
141 | }
142 | }
143 |
--------------------------------------------------------------------------------
/src/main/java/net/openhft/chronicle/engine/gui/Login.java:
--------------------------------------------------------------------------------
1 | package net.openhft.chronicle.engine.gui;
2 |
3 | import com.vaadin.data.validator.AbstractValidator;
4 | import com.vaadin.event.UIEvents;
5 | import com.vaadin.navigator.Navigator;
6 | import com.vaadin.navigator.View;
7 | import com.vaadin.navigator.ViewChangeListener;
8 | import com.vaadin.server.StreamResource;
9 | import com.vaadin.shared.ui.MarginInfo;
10 | import com.vaadin.ui.*;
11 | import com.vaadin.ui.themes.Reindeer;
12 | import net.openhft.chronicle.core.annotation.Nullable;
13 | import net.openhft.chronicle.engine.tree.VanillaAssetTree;
14 | import net.openhft.chronicle.network.VanillaSessionDetails;
15 | import net.openhft.chronicle.network.connection.ClientConnectionMonitor;
16 | import org.jetbrains.annotations.NotNull;
17 |
18 | import java.net.SocketAddress;
19 |
20 | import static net.openhft.chronicle.engine.gui.EntryPoint.MAINVIEW;
21 | import static net.openhft.chronicle.engine.gui.EntryPoint.remote;
22 |
23 | public class Login extends CustomComponent implements View, Button.ClickListener {
24 |
25 | private static final String NAME = "login";
26 | private static final String DEFAULT_HOSTPORT = "localhost:9090";
27 | private static final String DEFAULT_USER = "admin";
28 | @NotNull
29 | private final TextField user;
30 | @NotNull
31 | private final TextField hostPort;
32 | @NotNull
33 | private final PasswordField password;
34 | @NotNull
35 | private final Button loginButton;
36 | private final Navigator navigator;
37 |
38 | @org.jetbrains.annotations.Nullable
39 | private volatile UIEvents.PollListener eventListener;
40 | @org.jetbrains.annotations.Nullable
41 | private volatile VanillaAssetTree remoteTree = null;
42 | @org.jetbrains.annotations.Nullable
43 | private volatile Boolean isConnected = null;
44 |
45 | public Login(Navigator navigator, final String caption) {
46 | this.navigator = navigator;
47 |
48 | setSizeFull();
49 |
50 | // Create the host input field
51 | hostPort = new TextField("HostPort:");
52 | hostPort.setWidth("300px");
53 |
54 | hostPort.setInputPrompt(DEFAULT_HOSTPORT);
55 | hostPort.setInvalidAllowed(false);
56 |
57 | @NotNull StreamResource streamResource = new StreamResource((StreamResource.StreamSource) () -> Login.class.getResourceAsStream("Chronicle-Engine_200px.png"), "Chronicle-Engine_200px.png");
58 |
59 | @NotNull Image image = new Image("", streamResource);
60 |
61 | // Create the user input field
62 | user = new TextField("User:");
63 | user.setWidth("300px");
64 | user.setInputPrompt(DEFAULT_USER);
65 | user.setInvalidAllowed(false);
66 |
67 | // Create the password input field
68 | password = new PasswordField("Password:");
69 | password.setWidth("300px");
70 | password.addValidator(new PasswordValidator());
71 |
72 | password.setValue("");
73 | password.setNullRepresentation("");
74 |
75 | // Create login button
76 | loginButton = new Button("Login", this);
77 | loginButton.setDisableOnClick(true);
78 |
79 | // Add both to a panel
80 | @NotNull VerticalLayout fields = new VerticalLayout(image, hostPort, user, password, loginButton);
81 | fields.setCaption(caption);
82 | fields.setSpacing(true);
83 | fields.setMargin(new MarginInfo(true, true, true, false));
84 | fields.setSizeUndefined();
85 |
86 | // The view root layout
87 | @NotNull VerticalLayout viewLayout = new VerticalLayout(fields);
88 | viewLayout.setSizeFull();
89 | viewLayout.setComponentAlignment(fields, Alignment.MIDDLE_CENTER);
90 | viewLayout.setStyleName(Reindeer.LAYOUT_BLUE);
91 | setCompositionRoot(viewLayout);
92 | }
93 |
94 | @Override
95 | public void enter(ViewChangeListener.ViewChangeEvent event0) {
96 | // focus the username field when user arrives to the login view
97 | isConnected = null;
98 |
99 | @org.jetbrains.annotations.Nullable UIEvents.PollListener eventListener0 = this.eventListener;
100 | if (eventListener0 != null)
101 | getUI().getCurrent().removePollListener(eventListener0);
102 |
103 | this.eventListener = event -> {
104 | if (isConnected == null)
105 | return;
106 | if (isConnected) {
107 | getSession().setAttribute("tree", remoteTree);
108 | navigator.navigateTo(MAINVIEW);
109 | getUI().getCurrent().removePollListener(this.eventListener);
110 | this.eventListener = null;
111 | } else {
112 | getSession().setAttribute("tree", null);
113 | remoteTree.close();
114 | remoteTree = null;
115 | navigator.navigateTo("");
116 | isConnected = null;
117 | getUI().getCurrent().removePollListener(this.eventListener);
118 | this.eventListener = null;
119 | }
120 | };
121 |
122 | getUI().getCurrent().setPollInterval(1000);
123 | getUI().getCurrent().addPollListener(this.eventListener);
124 |
125 | }
126 |
127 | @Override
128 | public void buttonClick(Button.ClickEvent event) {
129 |
130 | String username = user.getValue();
131 | String password = this.password.getValue();
132 |
133 |
134 | // Navigate to main view
135 | //getUI().getNavigator().navigateTo(NAME);
136 | final String hostPort = this.hostPort.getValue();
137 |
138 | @NotNull final VanillaSessionDetails sessionDetails = new VanillaSessionDetails();
139 | @NotNull String userId = username == null || username.isEmpty() ? DEFAULT_USER : username;
140 | sessionDetails.userId(userId);
141 | sessionDetails.securityToken(password);
142 |
143 |
144 | @NotNull final String remoteHost = "".isEmpty() ? DEFAULT_HOSTPORT : hostPort;
145 |
146 |
147 | @NotNull final ClientConnectionMonitor monitor = new ClientConnectionMonitor() {
148 |
149 | @Override
150 | public void onConnected(@Nullable String name,
151 | @NotNull SocketAddress socketAddress) {
152 | isConnected = true;
153 | }
154 |
155 | @Override
156 | public void onDisconnected(@Nullable String name,
157 | @NotNull SocketAddress socketAddress) {
158 | isConnected = false;
159 | }
160 | };
161 |
162 | remoteTree = remote(remoteHost, sessionDetails, monitor);
163 |
164 | }
165 |
166 | // Validator for validating the passwords
167 | private static final class PasswordValidator extends
168 | AbstractValidator {
169 |
170 | private PasswordValidator() {
171 | super("The password provided is not valid");
172 | }
173 |
174 | @Override
175 | protected boolean isValidValue(String value) {
176 | return true;
177 | }
178 |
179 | @NotNull
180 | @Override
181 | public Class getType() {
182 | return String.class;
183 | }
184 | }
185 |
186 |
187 | }
--------------------------------------------------------------------------------
/src/main/java/net/openhft/chronicle/engine/gui/MainControl.java:
--------------------------------------------------------------------------------
1 | package net.openhft.chronicle.engine.gui;
2 |
3 | import com.vaadin.ui.Component;
4 | import com.vaadin.ui.VerticalLayout;
5 | import net.openhft.chronicle.engine.api.tree.AssetTree;
6 | import org.jetbrains.annotations.NotNull;
7 |
8 | /**
9 | * @author Rob Austin.
10 | */
11 | class MainControl {
12 |
13 | private final UserControl userUiManager = new UserControl();
14 |
15 | @NotNull
16 | Component newComponent(@NotNull final AssetTree remoteAssetTree) {
17 | @NotNull MainUI mainUI = new MainUI();
18 | @NotNull Component userComponent = userUiManager.newComponent();
19 |
20 |
21 | VerticalLayout content = mainUI.content;
22 |
23 | mainUI.userButton.addClickListener(clickEvent -> {
24 | content.removeAllComponents();
25 | content.addComponent(userUiManager.newComponent());
26 | });
27 |
28 | @NotNull TreeUI treeUI = new TreeUI();
29 | new TreeController(remoteAssetTree, treeUI);
30 |
31 | mainUI.treeButton.addClickListener(clickEvent -> {
32 | content.removeAllComponents();
33 | content.addComponent(treeUI);
34 | });
35 |
36 |
37 | mainUI.content.addComponent(treeUI);
38 |
39 | return mainUI;
40 | }
41 |
42 | }
43 |
44 |
--------------------------------------------------------------------------------
/src/main/java/net/openhft/chronicle/engine/gui/MainUI.java:
--------------------------------------------------------------------------------
1 | package net.openhft.chronicle.engine.gui;
2 |
3 | import com.vaadin.annotations.AutoGenerated;
4 | import com.vaadin.annotations.DesignRoot;
5 | import com.vaadin.ui.declarative.Design;
6 | import com.vaadin.ui.HorizontalLayout;
7 | import com.vaadin.ui.Label;
8 | import com.vaadin.ui.Button;
9 | import com.vaadin.ui.CssLayout;
10 | import com.vaadin.ui.VerticalLayout;
11 |
12 | /**
13 | * !! DO NOT EDIT THIS FILE !!
14 | *
15 | * This class is generated by Vaadin Designer and will be overwritten.
16 | *
17 | * Please make a subclass with logic and additional interfaces as needed,
18 | * e.g class LoginView extends LoginDesign implements View { }
19 | */
20 | @DesignRoot
21 | @AutoGenerated
22 | @SuppressWarnings("serial")
23 | public class MainUI extends HorizontalLayout {
24 | protected HorizontalLayout menuTitle;
25 | protected Label menuTitleLabel;
26 | protected Button menuToggle;
27 | protected CssLayout menuItems;
28 | protected Button userButton;
29 | protected Button treeButton;
30 | protected VerticalLayout content;
31 |
32 | public MainUI() {
33 | Design.read(this);
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/src/main/java/net/openhft/chronicle/engine/gui/MapViewUI.java:
--------------------------------------------------------------------------------
1 | package net.openhft.chronicle.engine.gui;
2 |
3 | import com.vaadin.annotations.AutoGenerated;
4 | import com.vaadin.annotations.DesignRoot;
5 | import com.vaadin.ui.Button;
6 | import com.vaadin.ui.Label;
7 | import com.vaadin.ui.VerticalLayout;
8 | import com.vaadin.ui.declarative.Design;
9 |
10 | /**
11 | * !! DO NOT EDIT THIS FILE !!
12 | *
13 | * This class is generated by Vaadin Designer and will be overwritten.
14 | *
15 | * Please make a subclass with logic and additional interfaces as needed,
16 | * e.g class LoginView extends LoginDesign implements View { }
17 | */
18 | @DesignRoot
19 | @AutoGenerated
20 | @SuppressWarnings("serial")
21 | public class MapViewUI extends VerticalLayout {
22 | protected Label entrySubscriberCount;
23 | protected Label recordCount;
24 | protected Label topicSubscriberCount;
25 | protected Label keySubscriberCount;
26 | protected Label path;
27 | protected Label keyStoreValue;
28 | protected VerticalLayout gridHolder;
29 | protected Button addButton;
30 |
31 | public MapViewUI() {
32 | Design.read(this);
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/src/main/java/net/openhft/chronicle/engine/gui/MyStatement.java:
--------------------------------------------------------------------------------
1 | package net.openhft.chronicle.engine.gui;
2 |
3 | import org.intellij.lang.annotations.MagicConstant;
4 | import org.jetbrains.annotations.NotNull;
5 |
6 | import java.sql.*;
7 |
8 | /**
9 | * @author Rob Austin.
10 | */
11 | public class MyStatement implements Statement {
12 | @NotNull
13 | @Override
14 | public ResultSet executeQuery(String sql) throws SQLException {
15 | throw new UnsupportedOperationException("todo");
16 | }
17 |
18 | @Override
19 | public int executeUpdate(String sql) throws SQLException {
20 | throw new UnsupportedOperationException("todo");
21 | }
22 |
23 | @Override
24 | public void close() throws SQLException {
25 |
26 | }
27 |
28 | @Override
29 | public int getMaxFieldSize() throws SQLException {
30 | throw new UnsupportedOperationException("todo");
31 | }
32 |
33 | @Override
34 | public void setMaxFieldSize(int max) throws SQLException {
35 | throw new UnsupportedOperationException("todo");
36 | }
37 |
38 | @Override
39 | public int getMaxRows() throws SQLException {
40 | throw new UnsupportedOperationException("todo");
41 | }
42 |
43 | @Override
44 | public void setMaxRows(int max) throws SQLException {
45 | throw new UnsupportedOperationException("todo");
46 | }
47 |
48 | @Override
49 | public void setEscapeProcessing(boolean enable) throws SQLException {
50 | throw new UnsupportedOperationException("todo");
51 | }
52 |
53 | @Override
54 | public int getQueryTimeout() throws SQLException {
55 | throw new UnsupportedOperationException("todo");
56 | }
57 |
58 | @Override
59 | public void setQueryTimeout(int seconds) throws SQLException {
60 | throw new UnsupportedOperationException("todo");
61 | }
62 |
63 | @Override
64 | public void cancel() throws SQLException {
65 | throw new UnsupportedOperationException("todo");
66 | }
67 |
68 | @NotNull
69 | @Override
70 | public SQLWarning getWarnings() throws SQLException {
71 | throw new UnsupportedOperationException("todo");
72 | }
73 |
74 | @Override
75 | public void clearWarnings() throws SQLException {
76 | throw new UnsupportedOperationException("todo");
77 | }
78 |
79 | @Override
80 | public void setCursorName(String name) throws SQLException {
81 | throw new UnsupportedOperationException("todo");
82 | }
83 |
84 | @Override
85 | public boolean execute(String sql) throws SQLException {
86 | throw new UnsupportedOperationException("todo");
87 | }
88 |
89 | @NotNull
90 | @Override
91 | public ResultSet getResultSet() throws SQLException {
92 | throw new UnsupportedOperationException("todo");
93 | }
94 |
95 | @Override
96 | public int getUpdateCount() throws SQLException {
97 | throw new UnsupportedOperationException("todo");
98 | }
99 |
100 | @Override
101 | public boolean getMoreResults() throws SQLException {
102 | throw new UnsupportedOperationException("todo");
103 | }
104 |
105 | @Override
106 | public void setFetchDirection(@MagicConstant(intValues = {ResultSet.FETCH_FORWARD, ResultSet.FETCH_REVERSE, ResultSet.FETCH_UNKNOWN}) int direction) throws SQLException {
107 | throw new UnsupportedOperationException("todo");
108 | }
109 |
110 | @Override
111 | public int getFetchDirection() throws SQLException {
112 | throw new UnsupportedOperationException("todo");
113 | }
114 |
115 | @Override
116 | public void setFetchSize(int rows) throws SQLException {
117 | throw new UnsupportedOperationException("todo");
118 | }
119 |
120 | @Override
121 | public int getFetchSize() throws SQLException {
122 | throw new UnsupportedOperationException("todo");
123 | }
124 |
125 | @Override
126 | public int getResultSetConcurrency() throws SQLException {
127 | throw new UnsupportedOperationException("todo");
128 | }
129 |
130 | @Override
131 | public int getResultSetType() throws SQLException {
132 | throw new UnsupportedOperationException("todo");
133 | }
134 |
135 | @Override
136 | public void addBatch(String sql) throws SQLException {
137 | throw new UnsupportedOperationException("todo");
138 | }
139 |
140 | @Override
141 | public void clearBatch() throws SQLException {
142 | throw new UnsupportedOperationException("todo");
143 | }
144 |
145 | @NotNull
146 | @Override
147 | public int[] executeBatch() throws SQLException {
148 | throw new UnsupportedOperationException("todo");
149 | }
150 |
151 | @NotNull
152 | @Override
153 | public Connection getConnection() throws SQLException {
154 | throw new UnsupportedOperationException("todo");
155 | }
156 |
157 | @Override
158 | public boolean getMoreResults(@MagicConstant(intValues = {Statement.CLOSE_CURRENT_RESULT, Statement.KEEP_CURRENT_RESULT, Statement.CLOSE_ALL_RESULTS}) int current) throws SQLException {
159 | throw new UnsupportedOperationException("todo");
160 | }
161 |
162 | @NotNull
163 | @Override
164 | public ResultSet getGeneratedKeys() throws SQLException {
165 | throw new UnsupportedOperationException("todo");
166 | }
167 |
168 | @Override
169 | public int executeUpdate(String sql, @MagicConstant(intValues = {Statement.RETURN_GENERATED_KEYS, Statement.NO_GENERATED_KEYS}) int autoGeneratedKeys) throws SQLException {
170 | throw new UnsupportedOperationException("todo");
171 | }
172 |
173 | @Override
174 | public int executeUpdate(String sql, int[] columnIndexes) throws SQLException {
175 | throw new UnsupportedOperationException("todo");
176 | }
177 |
178 | @Override
179 | public int executeUpdate(String sql, String[] columnNames) throws SQLException {
180 | throw new UnsupportedOperationException("todo");
181 | }
182 |
183 | @Override
184 | public boolean execute(String sql, int autoGeneratedKeys) throws SQLException {
185 | throw new UnsupportedOperationException("todo");
186 | }
187 |
188 | @Override
189 | public boolean execute(String sql, int[] columnIndexes) throws SQLException {
190 | throw new UnsupportedOperationException("todo");
191 | }
192 |
193 | @Override
194 | public boolean execute(String sql, String[] columnNames) throws SQLException {
195 | throw new UnsupportedOperationException("todo");
196 | }
197 |
198 | @Override
199 | public int getResultSetHoldability() throws SQLException {
200 | throw new UnsupportedOperationException("todo");
201 | }
202 |
203 | @Override
204 | public boolean isClosed() throws SQLException {
205 | throw new UnsupportedOperationException("todo");
206 | }
207 |
208 | @Override
209 | public void setPoolable(boolean poolable) throws SQLException {
210 | throw new UnsupportedOperationException("todo");
211 | }
212 |
213 | @Override
214 | public boolean isPoolable() throws SQLException {
215 | throw new UnsupportedOperationException("todo");
216 | }
217 |
218 | @Override
219 | public void closeOnCompletion() throws SQLException {
220 | throw new UnsupportedOperationException("todo");
221 | }
222 |
223 | @Override
224 | public boolean isCloseOnCompletion() throws SQLException {
225 | throw new UnsupportedOperationException("todo");
226 | }
227 |
228 | @NotNull
229 | @Override
230 | public T unwrap(Class iface) throws SQLException {
231 | throw new UnsupportedOperationException("todo");
232 | }
233 |
234 | @Override
235 | public boolean isWrapperFor(Class> iface) throws SQLException {
236 | throw new UnsupportedOperationException("todo");
237 | }
238 | }
239 |
--------------------------------------------------------------------------------
/src/main/java/net/openhft/chronicle/engine/gui/QueueViewUI.java:
--------------------------------------------------------------------------------
1 | package net.openhft.chronicle.engine.gui;
2 |
3 | import com.vaadin.annotations.AutoGenerated;
4 | import com.vaadin.annotations.DesignRoot;
5 | import com.vaadin.ui.declarative.Design;
6 | import com.vaadin.ui.VerticalLayout;
7 | import com.vaadin.ui.Grid;
8 | import com.vaadin.ui.Label;
9 |
10 | /**
11 | * !! DO NOT EDIT THIS FILE !!
12 | *
13 | * This class is generated by Vaadin Designer and will be overwritten.
14 | *
15 | * Please make a subclass with logic and additional interfaces as needed,
16 | * e.g class LoginView extends LoginDesign implements View { }
17 | */
18 | @DesignRoot
19 | @AutoGenerated
20 | @SuppressWarnings("serial")
21 | public class QueueViewUI extends VerticalLayout {
22 | protected Label path;
23 | protected Grid datagrid;
24 |
25 | public QueueViewUI() {
26 | Design.read(this);
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/src/main/java/net/openhft/chronicle/engine/gui/TimeStampSearch.java:
--------------------------------------------------------------------------------
1 | package net.openhft.chronicle.engine.gui;
2 |
3 | import com.vaadin.event.FieldEvents;
4 | import com.vaadin.server.Sizeable;
5 | import com.vaadin.ui.*;
6 | import org.jetbrains.annotations.NotNull;
7 |
8 | import java.text.DateFormatSymbols;
9 | import java.time.DateTimeException;
10 | import java.time.ZoneOffset;
11 | import java.time.ZonedDateTime;
12 | import java.util.*;
13 | import java.util.Calendar;
14 | import java.util.function.Consumer;
15 | import java.util.function.Supplier;
16 |
17 | import static com.vaadin.data.Property.ValueChangeListener;
18 | import static java.util.Arrays.asList;
19 |
20 | /**
21 | * @author Rob Austin.
22 | */
23 | class TimeStampSearch {
24 |
25 | private final static String[] MONTHS_ARRAY = Arrays.copyOf(new DateFormatSymbols().getMonths
26 | (), 12);
27 | public static final List MONTHS = asList(MONTHS_ARRAY);
28 |
29 | public static final int COMBO_BOX_WIDTH = 80;
30 | @NotNull
31 | private final TextField filterField;
32 | private final FieldEvents.TextChangeListener textChangeListener;
33 |
34 | private boolean hasFocus;
35 |
36 | public TimeStampSearch(@NotNull TextField filterField, FieldEvents.TextChangeListener textChangeListener) {
37 | this.filterField = filterField;
38 | this.textChangeListener = textChangeListener;
39 | }
40 |
41 | boolean hasFocus() {
42 | return hasFocus;
43 | }
44 |
45 | private class MyTextChangeEvent extends FieldEvents.TextChangeEvent {
46 |
47 | private final String newValue;
48 |
49 | MyTextChangeEvent(String newValue) {
50 | super(filterField);
51 | this.newValue = newValue;
52 | }
53 |
54 | @Override
55 | public String getText() {
56 | return newValue;
57 | }
58 |
59 | @Override
60 | public int getCursorPosition() {
61 | throw new UnsupportedOperationException("todo");
62 | }
63 | }
64 |
65 | void doSearch() {
66 |
67 | @NotNull final String value = filterField.getValue().trim();
68 |
69 | long lower = System.currentTimeMillis();
70 | long upper = System.currentTimeMillis();
71 |
72 | if ((value.startsWith("[") || value.startsWith("("))
73 | && (value.endsWith("]") || value.endsWith(")"))) {
74 |
75 | boolean startExclusive = value.startsWith("(");
76 | boolean endInclusive = value.startsWith("]");
77 |
78 | @NotNull String substring = value.substring(1, value.length() - 1);
79 | @NotNull String[] split = substring.split("\\,");
80 |
81 | if (split.length == 2) {
82 | lower = Long.parseLong(split[0].trim());
83 | upper = Long.parseLong(split[1].trim());
84 | }
85 |
86 | if (startExclusive) lower++;
87 |
88 | if (endInclusive) upper++;
89 |
90 | }
91 |
92 |
93 | // Create a sub-window and set the content
94 | @NotNull Window subWindow = new Window("Search - Date Time Range");
95 | subWindow.setClosable(false);
96 | subWindow.setModal(true);
97 | subWindow.setResizeLazy(true);
98 | subWindow.setResizable(false);
99 | subWindow.setSizeUndefined();
100 | subWindow.setWidth(920, Sizeable.Unit.PIXELS);
101 | subWindow.setDraggable(true);
102 | hasFocus = true;
103 |
104 |
105 | @NotNull FormLayout form = new FormLayout();
106 | form.setMargin(false);
107 |
108 | @NotNull AbstractOrderedLayout fromLayout = new HorizontalLayout();
109 |
110 | @NotNull Label fromMillisLabel = new Label("fromMillisLabel");
111 | fromMillisLabel.setValue("" + lower + " milliseconds UTC");
112 | @NotNull Supplier supplyFromMillisUtc = addComboBoxes(fromLayout, s -> fromMillisLabel
113 | .setValue(s.toString() + " milliseconds UTC"), lower);
114 |
115 | {
116 | @NotNull HorizontalLayout components0 = new HorizontalLayout();
117 | components0.addComponent(new Label("From: UTC time [inclusive]:"));
118 | @NotNull HorizontalLayout c = new HorizontalLayout();
119 | c.setWidth(100, Sizeable.Unit.PERCENTAGE);
120 | components0.addComponent(c);
121 | components0.addComponent(fromMillisLabel);
122 | components0.setWidth(100, Sizeable.Unit.PERCENTAGE);
123 | form.addComponent(components0);
124 | }
125 |
126 | form.addComponent(fromLayout);
127 | form.setComponentAlignment(fromLayout, Alignment.MIDDLE_LEFT);
128 |
129 | @NotNull AbstractOrderedLayout toLayout = new HorizontalLayout();
130 | @NotNull Label toMillisLabel = new Label("toMillisLabel");
131 | toMillisLabel.setValue("" + upper + " milliseconds UTC");
132 | @NotNull Supplier supplyToMillisUtc = addComboBoxes(toLayout, s -> toMillisLabel.setValue
133 | (s.toString() + " milliseconds UTC"), upper);
134 | {
135 | @NotNull HorizontalLayout components0 = new HorizontalLayout();
136 | components0.addComponent(new Label("To: UTC time (exclusive):"));
137 | @NotNull HorizontalLayout c = new HorizontalLayout();
138 | c.setWidth(100, Sizeable.Unit.PERCENTAGE);
139 | components0.addComponent(c);
140 | components0.addComponent(toMillisLabel);
141 | components0.setWidth(100, Sizeable.Unit.PERCENTAGE);
142 | form.addComponent(components0);
143 | }
144 |
145 | form.addComponent(toLayout);
146 | form.setComponentAlignment(toLayout, Alignment.MIDDLE_LEFT);
147 |
148 | // buttons layout ---------------
149 |
150 | @NotNull HorizontalLayout buttonParentLayout = new HorizontalLayout();
151 | buttonParentLayout.setWidth(100, Sizeable.Unit.PERCENTAGE);
152 |
153 | buttonParentLayout.setMargin(true);
154 | @NotNull HorizontalLayout padding = new HorizontalLayout();
155 | padding.setWidth(100, Sizeable.Unit.PERCENTAGE);
156 | buttonParentLayout.addComponent(padding);
157 | buttonParentLayout.setComponentAlignment(padding, Alignment.MIDDLE_LEFT);
158 |
159 | @NotNull HorizontalLayout buttons = new HorizontalLayout();
160 | buttons.setSpacing(true);
161 |
162 | // ---------------
163 |
164 |
165 | @NotNull final Button doneButton = new Button("Done");
166 | doneButton.addClickListener((Button.ClickListener) event1 -> {
167 | subWindow.close();
168 |
169 | long fromMillis = supplyFromMillisUtc.get();
170 | long toMillis = supplyToMillisUtc.get();
171 |
172 | @NotNull String newValue = "[" + fromMillis + "," + toMillis + ")";
173 | filterField.setValue(newValue);
174 | textChangeListener.textChange(new MyTextChangeEvent(newValue));
175 | });
176 |
177 | @NotNull final Button clearButton = new Button("Clear");
178 | clearButton.addClickListener((Button.ClickListener) event1 -> {
179 | subWindow.close();
180 | @NotNull String newValue = "";
181 | filterField.setValue(newValue);
182 | textChangeListener.textChange(new MyTextChangeEvent(""));
183 | });
184 |
185 |
186 | buttons.addComponent(clearButton);
187 | buttons.addComponent(doneButton);
188 | buttonParentLayout.addComponent(buttons);
189 | buttonParentLayout.setComponentAlignment(buttons, Alignment.MIDDLE_RIGHT);
190 |
191 | form.addComponent(buttonParentLayout);
192 | form.setComponentAlignment(buttonParentLayout, Alignment.MIDDLE_RIGHT);
193 |
194 | subWindow.setContent(form);
195 |
196 | // Center it in the browser window
197 | subWindow.center();
198 |
199 | // Open it in the UI
200 | UI.getCurrent().addWindow(subWindow);
201 | }
202 |
203 |
204 | @NotNull
205 | private Supplier addComboBoxes(@NotNull final AbstractOrderedLayout result, @NotNull Consumer
206 | onChange, long milliSecondsUtc) {
207 |
208 | @NotNull final AbstractOrderedLayout dayLayout = new HorizontalLayout();
209 | dayLayout.setMargin(true);
210 |
211 | @NotNull final ComboBox day = dayComboBox(milliSecondsUtc);
212 | day.setNullSelectionAllowed(false);
213 | @NotNull ComboBox month = monthComboBox(milliSecondsUtc);
214 | month.setNullSelectionAllowed(false);
215 | @NotNull ComboBox year = yearCombBox(milliSecondsUtc);
216 | year.setNullSelectionAllowed(false);
217 |
218 | dayLayout.setSpacing(true);
219 | dayLayout.addComponent(day);
220 | dayLayout.addComponent(month);
221 | dayLayout.addComponent(year);
222 | result.addComponent(dayLayout);
223 | result.setComponentAlignment(dayLayout, Alignment.MIDDLE_LEFT);
224 |
225 | @NotNull final AbstractOrderedLayout timeLayout = new HorizontalLayout();
226 | @NotNull final ComboBox hour = hourCombBox(milliSecondsUtc);
227 | hour.setNullSelectionAllowed(false);
228 | @NotNull ComboBox min = minCombBox(milliSecondsUtc);
229 | min.setNullSelectionAllowed(false);
230 |
231 | @NotNull final ComboBox seconds = secCombBox(milliSecondsUtc);
232 | seconds.setNullSelectionAllowed(false);
233 |
234 | @NotNull final ComboBox milliseconds = millisecondsCombBox(milliSecondsUtc);
235 | milliseconds.setNullSelectionAllowed(false);
236 |
237 | timeLayout.setSpacing(true);
238 | timeLayout.addComponent(hour);
239 | timeLayout.addComponent(min);
240 | timeLayout.addComponent(seconds);
241 | timeLayout.addComponent(milliseconds);
242 | result.addComponent(timeLayout);
243 | result.setComponentAlignment(timeLayout, Alignment.MIDDLE_RIGHT);
244 |
245 | @NotNull final Supplier utcMillisSupplier = () -> {
246 | for (int i = 0; i < 5; i++) {
247 |
248 | int year0 = Integer.valueOf(year.getValue().toString());
249 |
250 | int month0 = monthSelected(month);
251 | int dayOfMonth0 = Integer.valueOf(day.getValue().toString());
252 | int hour0 = Integer.valueOf(hour.getValue().toString());
253 | int minute0 = Integer.valueOf(min.getValue().toString());
254 | int second0 = Integer.valueOf(seconds.getValue().toString());
255 | int milliseconds0 = Integer.valueOf(milliseconds.getValue().toString());
256 | int nanoOfSecond0 = milliseconds0 * 1_000_000;
257 |
258 | try {
259 | final ZonedDateTime time = ZonedDateTime.of(year0,
260 | month0, dayOfMonth0, hour0, minute0, second0,
261 | nanoOfSecond0, ZoneOffset.UTC);
262 | return (time.toEpochSecond() * 1000) + milliseconds0;
263 | } catch (DateTimeException e) {
264 | day.setValue(Integer.toString(dayOfMonth0 - 1));
265 | }
266 |
267 | }
268 | throw new IllegalStateException();
269 | };
270 |
271 | @NotNull final ValueChangeListener listener = event -> onChange.accept(utcMillisSupplier.get());
272 | day.addValueChangeListener(listener);
273 | month.addValueChangeListener(listener);
274 | year.addValueChangeListener(listener);
275 | hour.addValueChangeListener(listener);
276 | min.addValueChangeListener(listener);
277 | seconds.addValueChangeListener(listener);
278 | milliseconds.addValueChangeListener(listener);
279 |
280 | return utcMillisSupplier;
281 |
282 | }
283 |
284 | private int monthSelected(@NotNull ComboBox month) {
285 | int i = MONTHS.indexOf(month.getValue());
286 | if (i == -1)
287 | i = 0;
288 | return i + 1;
289 | }
290 |
291 | @NotNull
292 | private ComboBox monthComboBox(long utcTime) {
293 |
294 | @NotNull final ComboBox month = new ComboBox("month", MONTHS);
295 |
296 | month.setInvalidAllowed(false);
297 | month.setNullSelectionAllowed(false);
298 | month.addItems(MONTHS);
299 | month.setWidth(150, Sizeable.Unit.PIXELS);
300 | Calendar instance = Calendar.getInstance();
301 | instance.setTime(new Date(utcTime));
302 | month.setValue(MONTHS_ARRAY[instance.get(Calendar.MONTH)]);
303 |
304 | return month;
305 | }
306 |
307 | @NotNull
308 | private ComboBox dayComboBox(long utcTime) {
309 |
310 | @NotNull ComboBox result = new ComboBox("day");
311 |
312 | result.setInvalidAllowed(false);
313 | result.setNullSelectionAllowed(false);
314 | result.setWidth(COMBO_BOX_WIDTH, Sizeable.Unit.PIXELS);
315 | @NotNull List days = new ArrayList<>();
316 | for (int i = 1; i <= 31; i++) {
317 | days.add(Integer.toString(i));
318 | }
319 |
320 | result.addItems(days);
321 |
322 | final Calendar instance = Calendar.getInstance();
323 | instance.setTime(new Date(utcTime));
324 | result.setValue(Integer.toString(instance.get(Calendar.DAY_OF_MONTH)));
325 | return result;
326 | }
327 |
328 |
329 | @NotNull
330 | private ComboBox yearCombBox(long utcTime) {
331 |
332 | @NotNull ComboBox result = new ComboBox("year");
333 |
334 | result.setInvalidAllowed(false);
335 | result.setNullSelectionAllowed(false);
336 | result.setWidth(100, Sizeable.Unit.PIXELS);
337 | @NotNull List years = new ArrayList<>();
338 | for (int i = 1970; i < 2070; i++) {
339 | years.add(Integer.toString(i));
340 | }
341 |
342 | result.addItems(years);
343 |
344 | final Calendar instance = Calendar.getInstance();
345 | instance.setTime(new Date(utcTime));
346 | result.setValue(Integer.toString(instance.get(Calendar.YEAR)));
347 | return result;
348 | }
349 |
350 |
351 | @NotNull
352 | private ComboBox hourCombBox(long utcTime) {
353 |
354 | @NotNull ComboBox result = new ComboBox("hour");
355 |
356 | result.setInvalidAllowed(false);
357 | result.setNullSelectionAllowed(false);
358 | result.setWidth(COMBO_BOX_WIDTH, Sizeable.Unit.PIXELS);
359 | @NotNull List hour = new ArrayList<>();
360 | for (int i = 0; i <= 23; i++) {
361 | hour.add(Integer.toString(i));
362 | }
363 |
364 | result.addItems(hour);
365 |
366 | final Calendar instance = Calendar.getInstance();
367 | instance.setTime(new Date(utcTime));
368 | result.setValue(Integer.toString(instance.get(Calendar.HOUR_OF_DAY)));
369 | return result;
370 | }
371 |
372 | @NotNull
373 | private ComboBox minCombBox(long utcTime) {
374 |
375 | @NotNull ComboBox result = new ComboBox("min");
376 |
377 | result.setInvalidAllowed(false);
378 | result.setNullSelectionAllowed(false);
379 | result.setWidth(COMBO_BOX_WIDTH, Sizeable.Unit.PIXELS);
380 | @NotNull List min = new ArrayList<>();
381 | for (int i = 0; i <= 59; i++) {
382 | min.add(Integer.toString(i));
383 | }
384 |
385 | result.addItems(min);
386 |
387 | final Calendar instance = Calendar.getInstance();
388 | instance.setTime(new Date(utcTime));
389 | result.setValue(Integer.toString(instance.get(Calendar.MINUTE)));
390 | return result;
391 | }
392 |
393 | @NotNull
394 | private ComboBox secCombBox(long utcTime) {
395 |
396 | @NotNull ComboBox result = new ComboBox("second");
397 |
398 | result.setInvalidAllowed(false);
399 | result.setNullSelectionAllowed(false);
400 | result.setWidth(COMBO_BOX_WIDTH, Sizeable.Unit.PIXELS);
401 | @NotNull List min = new ArrayList<>();
402 | for (int i = 0; i <= 59; i++) {
403 | min.add(Integer.toString(i));
404 | }
405 |
406 | result.addItems(min);
407 |
408 | final Calendar instance = Calendar.getInstance();
409 | instance.setTime(new Date(utcTime));
410 | result.setValue(Integer.toString(instance.get(Calendar.SECOND)));
411 | return result;
412 | }
413 |
414 | @NotNull
415 | private ComboBox millisecondsCombBox(long utcTime) {
416 |
417 | @NotNull ComboBox result = new ComboBox("milli-second");
418 |
419 | result.setInvalidAllowed(false);
420 | result.setNullSelectionAllowed(false);
421 | result.setWidth(120, Sizeable.Unit.PIXELS);
422 | @NotNull List min = new ArrayList<>();
423 | for (int i = 0; i <= 1000; i++) {
424 | min.add(Integer.toString(i));
425 | }
426 |
427 | result.addItems(min);
428 |
429 | final Calendar instance = Calendar.getInstance();
430 | instance.setTime(new Date(utcTime));
431 | long l = utcTime % 1000L;
432 |
433 | result.setValue("" + l);
434 | return result;
435 | }
436 |
437 |
438 | public void hasFocus(boolean hasFocus) {
439 | this.hasFocus = hasFocus;
440 | }
441 | }
442 |
--------------------------------------------------------------------------------
/src/main/java/net/openhft/chronicle/engine/gui/TreeController.java:
--------------------------------------------------------------------------------
1 | package net.openhft.chronicle.engine.gui;
2 |
3 | import com.vaadin.event.ItemClickEvent;
4 | import com.vaadin.server.StreamResource;
5 | import com.vaadin.ui.Tree;
6 | import net.openhft.chronicle.engine.api.column.ColumnViewInternal;
7 | import net.openhft.chronicle.engine.api.column.MapColumnView;
8 | import net.openhft.chronicle.engine.api.column.QueueColumnView;
9 | import net.openhft.chronicle.engine.api.column.VaadinChart;
10 | import net.openhft.chronicle.engine.api.map.MapView;
11 | import net.openhft.chronicle.engine.api.pubsub.Subscriber;
12 | import net.openhft.chronicle.engine.api.tree.Asset;
13 | import net.openhft.chronicle.engine.api.tree.AssetTree;
14 | import net.openhft.chronicle.engine.api.tree.RequestContext;
15 | import net.openhft.chronicle.engine.query.Filter;
16 | import net.openhft.chronicle.engine.tree.QueueView;
17 | import net.openhft.chronicle.engine.tree.TopologicalEvent;
18 | import net.openhft.chronicle.threads.NamedThreadFactory;
19 | import org.jetbrains.annotations.NotNull;
20 | import org.jetbrains.annotations.Nullable;
21 |
22 | import java.util.Set;
23 | import java.util.concurrent.ExecutorService;
24 | import java.util.concurrent.Executors;
25 |
26 | /**
27 | * @author Rob Austin.
28 | */
29 | class TreeController {
30 |
31 | static {
32 | RequestContext.loadDefaultAliases();
33 | }
34 |
35 | private static final String MAP_VIEW = "::map_view";
36 | private static final String QUEUE_VIEW = "::queue_view";
37 | private static final String BAR_CHART_VIEW = "::barchart_view";
38 | @NotNull
39 | final ItemClickEvent.ItemClickListener clickListener;
40 | @NotNull
41 | private final ChartUI histogramUI = new ChartUI();
42 | @NotNull
43 | static ExecutorService executorService = Executors.newSingleThreadExecutor(new NamedThreadFactory
44 | ("scheduler", true));
45 |
46 | TreeController(@NotNull final AssetTree remoteTree,
47 | @NotNull TreeUI treeUI) {
48 |
49 | final Tree tree = treeUI.tree;
50 |
51 | @NotNull RequestContext rc = RequestContext.requestContext("")
52 | .elementType(TopologicalEvent.class).bootstrap(true);
53 |
54 | @NotNull final Subscriber sub = e -> updateTree(tree, e, remoteTree);
55 | remoteTree.acquireSubscription(rc).registerSubscriber(rc, sub, Filter.empty());
56 |
57 | clickListener = click -> {
58 | final String source = click.getItemId().toString();
59 | treeUI.contents.removeAllComponents();
60 |
61 | if (source.endsWith(BAR_CHART_VIEW)) {
62 | @NotNull final Asset asset = findAsset(source, remoteTree);
63 | @NotNull VaadinChart chart = asset.acquireView(VaadinChart.class);
64 | treeUI.contents.addComponent(histogramUI.getChart(chart));
65 | return;
66 | }
67 |
68 | if (source.endsWith(MAP_VIEW) || source.endsWith(QUEUE_VIEW)) {
69 | @NotNull MapViewUI mapViewUI = new MapViewUI();
70 | treeUI.contents.addComponent(mapViewUI);
71 |
72 | @NotNull Asset asset = findAsset(source, remoteTree);
73 |
74 | @Nullable
75 | final ColumnViewInternal view = source.endsWith(MAP_VIEW) ?
76 | asset.acquireView(MapColumnView.class) :
77 | asset.acquireView(QueueColumnView.class);
78 |
79 | @NotNull
80 | ColumnViewController mapControl = new ColumnViewController(view,
81 | mapViewUI,
82 | path(source));
83 | mapControl.init();
84 |
85 | }
86 |
87 | };
88 |
89 | tree.addItemClickListener(clickListener);
90 | }
91 |
92 |
93 | @NotNull
94 | public Asset findAsset(@NotNull String source, @NotNull AssetTree remoteTree) {
95 | @NotNull final String path = path(source);
96 | return remoteTree.acquireAsset(path);
97 | }
98 |
99 | private String path(@NotNull String source) {
100 | final int len = source.length();
101 |
102 | for (@NotNull String view : new String[]{MAP_VIEW, QUEUE_VIEW, BAR_CHART_VIEW}) {
103 | if (source.endsWith(view))
104 | return source.substring(0, len - view.length());
105 | }
106 |
107 | throw new IllegalStateException();
108 | }
109 |
110 | private void updateTree(@NotNull Tree tree, @NotNull TopologicalEvent e, @NotNull AssetTree assetTree) {
111 |
112 | if (e.assetName() == null)
113 | return;
114 |
115 | tree.markAsDirty();
116 |
117 | tree.addItem(e.fullName());
118 | tree.setItemCaption(e.fullName(), e.name());
119 |
120 | if (!"/".equals(e.assetName()))
121 | tree.setParent(e.fullName(), e.assetName());
122 |
123 | tree.setItemIcon(e.fullName(), new StreamResource(
124 | () -> TreeController.class.getResourceAsStream("folder.png"), "folder"));
125 |
126 | tree.setChildrenAllowed(e.fullName(), true);
127 |
128 |
129 | Set viewTypes = e.viewTypes();
130 | viewTypes.forEach(System.out::println);
131 |
132 | try {
133 |
134 | if (viewTypes.stream().anyMatch(VaadinChart.class::isAssignableFrom))
135 | addBarChart(tree, e, assetTree);
136 |
137 | if (viewTypes.stream().anyMatch(QueueView.class::isAssignableFrom)) {
138 | addQueue(tree, e);
139 | return;
140 | }
141 |
142 | if (viewTypes.stream().anyMatch(MapView.class::isAssignableFrom)) {
143 | addMap(tree, e);
144 | return;
145 | }
146 |
147 | } catch (Throwable t) {
148 | t.printStackTrace();
149 | }
150 | }
151 |
152 | private void addBarChart(@NotNull final Tree tree, @NotNull TopologicalEvent e, @NotNull AssetTree
153 | assetTree) {
154 | tree.addItem(e.fullName() + BAR_CHART_VIEW);
155 | tree.setParent(e.fullName() + BAR_CHART_VIEW, e.fullName());
156 |
157 | // we can make an RPC call engine, while inside a TopologicalEvent
158 | executorService.submit(() -> {
159 | @NotNull VaadinChart chart = assetTree.acquireAsset(e.fullName()).acquireView(VaadinChart.class);
160 | final String menuLabel = chart.chartProperties().menuLabel;
161 | tree.setItemCaption(e.fullName() + BAR_CHART_VIEW, menuLabel == null ? "bar-chart" :
162 | menuLabel);
163 | });
164 |
165 | tree.setItemIcon(e.fullName() + BAR_CHART_VIEW, new StreamResource(
166 | () -> TreeController.class.getResourceAsStream("chart.png"), "chart"));
167 | tree.setChildrenAllowed(e.fullName() + BAR_CHART_VIEW, false);
168 | }
169 |
170 | private void addMap(@NotNull Tree tree, @NotNull TopologicalEvent e) {
171 | tree.addItem(e.fullName() + MAP_VIEW);
172 | tree.setParent(e.fullName() + MAP_VIEW, e.fullName());
173 | tree.setItemCaption(e.fullName() + MAP_VIEW, "map");
174 | tree.setItemIcon(e.fullName() + MAP_VIEW, new StreamResource(
175 | () -> TreeController.class.getResourceAsStream("map.png"), "map"));
176 | tree.setChildrenAllowed(e.fullName() + MAP_VIEW, false);
177 | }
178 |
179 | private void addQueue(@NotNull Tree tree, @NotNull TopologicalEvent e) {
180 | tree.addItem(e.fullName() + QUEUE_VIEW);
181 | tree.setParent(e.fullName() + QUEUE_VIEW, e.fullName());
182 | tree.setItemCaption(e.fullName() + QUEUE_VIEW, "queue");
183 | tree.setItemIcon(e.fullName() + QUEUE_VIEW, new StreamResource(
184 | () -> TreeController.class.getResourceAsStream("queue.png"), "queue"));
185 | tree.setChildrenAllowed(e.fullName() + QUEUE_VIEW, false);
186 | }
187 |
188 | }
189 |
--------------------------------------------------------------------------------
/src/main/java/net/openhft/chronicle/engine/gui/TreeUI.java:
--------------------------------------------------------------------------------
1 | package net.openhft.chronicle.engine.gui;
2 |
3 | import com.vaadin.annotations.AutoGenerated;
4 | import com.vaadin.annotations.DesignRoot;
5 | import com.vaadin.ui.HorizontalLayout;
6 | import com.vaadin.ui.Tree;
7 | import com.vaadin.ui.VerticalLayout;
8 | import com.vaadin.ui.declarative.Design;
9 |
10 | /**
11 | * !! DO NOT EDIT THIS FILE !!
12 | *
13 | * This class is generated by Vaadin Designer and will be overwritten.
14 | *
15 | * Please make a subclass with logic and additional interfaces as needed,
16 | * e.g class LoginView extends LoginDesign implements View { }
17 | */
18 | @DesignRoot
19 | @AutoGenerated
20 | @SuppressWarnings("serial")
21 | public class TreeUI extends HorizontalLayout {
22 | protected Tree tree;
23 | protected VerticalLayout contents;
24 |
25 |
26 | public TreeUI() {
27 | Design.read(this);
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/src/main/java/net/openhft/chronicle/engine/gui/UserControl.java:
--------------------------------------------------------------------------------
1 | package net.openhft.chronicle.engine.gui;
2 |
3 | import com.vaadin.addon.charts.Chart;
4 | import com.vaadin.addon.charts.model.*;
5 | import com.vaadin.addon.charts.model.style.SolidColor;
6 | import com.vaadin.server.Sizeable;
7 | import com.vaadin.ui.Component;
8 | import com.vaadin.ui.UI;
9 | import org.jetbrains.annotations.NotNull;
10 | import org.jetbrains.annotations.Nullable;
11 |
12 | import java.util.Random;
13 | import java.util.concurrent.ExecutionException;
14 | import java.util.concurrent.Future;
15 |
16 | /**
17 | * @author Rob Austin.
18 | */
19 | class UserControl {
20 |
21 |
22 | @NotNull
23 | Component newComponent() {
24 | @NotNull final UserUI components = new UserUI();
25 | components.readBps.addComponent(newRandomChart("readBps"));
26 | components.writeBps.addComponent(newRandomChart("writeBps"));
27 | return components;
28 | }
29 |
30 | @NotNull
31 | private Chart newRandomChart(final String text) {
32 | @NotNull final Random random = new Random();
33 |
34 | @NotNull final Chart chart = new Chart();
35 | chart.setWidth("500px");
36 |
37 | final Configuration configuration = chart.getConfiguration();
38 |
39 | configuration.getChart().setType(ChartType.SPLINE);
40 | configuration.getTitle().setText(text);
41 |
42 | XAxis xAxis = configuration.getxAxis();
43 | xAxis.setType(AxisType.DATETIME);
44 | xAxis.setTickPixelInterval(200);
45 |
46 | YAxis yAxis = configuration.getyAxis();
47 | yAxis.setTitle(new AxisTitle("K Bytes Per Second"));
48 | yAxis.setPlotLines(new PlotLine(0, 1, new SolidColor("#808080")));
49 |
50 | configuration.getTooltip().setEnabled(false);
51 | configuration.getLegend().setEnabled(false);
52 |
53 | @NotNull final DataSeries series2 = new DataSeries();
54 | {
55 | @NotNull PlotOptionsLine plotOptions = new PlotOptionsLine();
56 | series2.setPlotOptions(plotOptions);
57 | }
58 | @NotNull final DataSeries series = new DataSeries();
59 | @NotNull PlotOptionsColumn plotOptions = new PlotOptionsColumn();
60 | plotOptions.setColor(new SolidColor("#F0F0F0"));
61 | series.setPlotOptions(plotOptions);
62 |
63 |
64 | series.setName("Random data");
65 | for (int i = -(5 * 60); i <= 0; i++) {
66 | series.add(new DataSeriesItem(
67 | System.currentTimeMillis() + i * 1000, random.nextDouble()));
68 | series2.add(new DataSeriesItem(
69 | System.currentTimeMillis() + i * 1000, 0.5 + ((random.nextDouble() * 0.2) -
70 | 0.1)));
71 | }
72 | runWhileAttached(chart, () -> {
73 | final long x = System.currentTimeMillis();
74 | final double y = random.nextDouble();
75 | @NotNull DataSeriesItem item = new DataSeriesItem(x, y);
76 | @NotNull DataSeriesItem item1 = new DataSeriesItem(x, 0.5 + ((random.nextDouble() * 0.2) -
77 | 0.1));
78 | series.add(item, true, true);
79 | series2.add(item1, true, true);
80 |
81 | series.update(item);
82 | series2.update(item1);
83 | }, 2000, 2000);
84 |
85 |
86 | configuration.addSeries(series);
87 | configuration.addSeries(series2);
88 |
89 | chart.drawChart(configuration);
90 | chart.setWidth(100, Sizeable.Unit.PERCENTAGE);
91 | return chart;
92 | }
93 |
94 |
95 | /**
96 | * Runs given task repeatedly until the reference component is attached
97 | *
98 | * @param component
99 | * @param task
100 | * @param interval
101 | * @param initialPause a timeout after tas is started
102 | */
103 | private static void runWhileAttached(@NotNull final Component component,
104 | final Runnable task,
105 | final int interval,
106 | final int initialPause) {
107 | // Until reliable push available in our demo servers
108 | UI.getCurrent().setPollInterval(interval);
109 |
110 | @NotNull final Thread thread = new Thread() {
111 | @Override
112 | public void run() {
113 | try {
114 | Thread.sleep(initialPause);
115 | while (component.getUI() != null) {
116 | Future future = component.getUI().access(task);
117 | future.get();
118 | Thread.sleep(interval);
119 | }
120 | } catch (@NotNull InterruptedException | com.vaadin.ui.UIDetachedException e) {
121 | } catch (ExecutionException e) {
122 | System.out.println("Stopping repeating command due to an exception");
123 |
124 | } catch (Exception e) {
125 | System.out.println("Unexpected exception while running scheduled update");
126 | }
127 | System.out.println("Thread stopped");
128 | }
129 |
130 | ;
131 | };
132 | thread.start();
133 | }
134 |
135 |
136 | }
137 |
--------------------------------------------------------------------------------
/src/main/java/net/openhft/chronicle/engine/gui/UserUI.java:
--------------------------------------------------------------------------------
1 | package net.openhft.chronicle.engine.gui;
2 |
3 | import com.vaadin.annotations.AutoGenerated;
4 | import com.vaadin.annotations.DesignRoot;
5 | import com.vaadin.ui.declarative.Design;
6 | import com.vaadin.ui.VerticalLayout;
7 | import com.vaadin.ui.ComboBox;
8 |
9 | /**
10 | * !! DO NOT EDIT THIS FILE !!
11 | *
12 | * This class is generated by Vaadin Designer and will be overwritten.
13 | *
14 | * Please make a subclass with logic and additional interfaces as needed,
15 | * e.g class LoginView extends LoginDesign implements View { }
16 | */
17 | @DesignRoot
18 | @AutoGenerated
19 | @SuppressWarnings("serial")
20 | public class UserUI extends VerticalLayout {
21 | protected ComboBox userName;
22 | protected VerticalLayout readBps;
23 | protected VerticalLayout writeBps;
24 |
25 | public UserUI() {
26 | Design.read(this);
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/src/main/resources/net/openhft/chronicle/engine/gui/Chronicle-Engine_200px.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenHFT/Chronicle-Engine-GUI/3ba5aacc23eff951050fabc682508f576200a3b1/src/main/resources/net/openhft/chronicle/engine/gui/Chronicle-Engine_200px.png
--------------------------------------------------------------------------------
/src/main/resources/net/openhft/chronicle/engine/gui/Chronicle-bar-graph_interface-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenHFT/Chronicle-Engine-GUI/3ba5aacc23eff951050fabc682508f576200a3b1/src/main/resources/net/openhft/chronicle/engine/gui/Chronicle-bar-graph_interface-icon.png
--------------------------------------------------------------------------------
/src/main/resources/net/openhft/chronicle/engine/gui/Chronicle-folder_interface-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenHFT/Chronicle-Engine-GUI/3ba5aacc23eff951050fabc682508f576200a3b1/src/main/resources/net/openhft/chronicle/engine/gui/Chronicle-folder_interface-icon.png
--------------------------------------------------------------------------------
/src/main/resources/net/openhft/chronicle/engine/gui/MainUI.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 | Chronicle Engine
14 |
15 |
16 |
17 | Menu
18 |
19 |
20 |
21 | User
22 |
23 |
24 | Tree
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/src/main/resources/net/openhft/chronicle/engine/gui/MapViewUI.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 | EntrySubscriberCount
16 |
17 |
18 |
19 |
20 | String
21 |
22 |
23 |
24 |
25 |
26 |
27 | NumberOfRecords
28 |
29 |
30 |
31 |
32 | String
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 | TopicSubscriberCount
43 |
44 |
45 |
46 |
47 | String
48 |
49 |
50 |
51 |
52 |
53 |
54 | KeySubscriberCount
55 |
56 |
57 |
58 |
59 | String
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 | Path
70 |
71 |
72 |
73 |
74 | /user/data/mymap
75 |
76 |
77 |
78 |
79 |
80 |
81 | KeyStore
82 |
83 |
84 |
85 |
86 | 102,322
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 | Add
98 |
99 |
100 |
101 |
102 |
103 |
--------------------------------------------------------------------------------
/src/main/resources/net/openhft/chronicle/engine/gui/QueueViewUI.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 | Path
17 |
18 |
19 |
20 |
21 | /user/data/myqueue
22 |
23 |
24 |
25 |
26 |
27 |
28 | Type
29 |
30 |
31 |
32 |
33 | Chronicle Queue
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 | Chronicle Queue
45 |
46 |
47 |
48 | Search
49 |
50 |
51 |
52 | records : 0..9 /1024
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 | Element |
63 |
64 |
65 |
66 |
67 | Customer Project 1 |
68 |
69 |
70 | Customer Project 2 |
71 |
72 |
73 | Customer Project 3 |
74 |
75 |
76 | Customer Project 4 |
77 |
78 |
79 | Customer Project 5 |
80 |
81 |
82 | Customer Project 6 |
83 |
84 |
85 | Customer Project 7 |
86 |
87 |
88 | Customer Project 8 |
89 |
90 |
91 | Customer Project 9 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
--------------------------------------------------------------------------------
/src/main/resources/net/openhft/chronicle/engine/gui/TreeUI.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/src/main/resources/net/openhft/chronicle/engine/gui/UserUI.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 | User
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/src/main/resources/net/openhft/chronicle/engine/gui/chart.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenHFT/Chronicle-Engine-GUI/3ba5aacc23eff951050fabc682508f576200a3b1/src/main/resources/net/openhft/chronicle/engine/gui/chart.png
--------------------------------------------------------------------------------
/src/main/resources/net/openhft/chronicle/engine/gui/folder.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenHFT/Chronicle-Engine-GUI/3ba5aacc23eff951050fabc682508f576200a3b1/src/main/resources/net/openhft/chronicle/engine/gui/folder.png
--------------------------------------------------------------------------------
/src/main/resources/net/openhft/chronicle/engine/gui/map.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenHFT/Chronicle-Engine-GUI/3ba5aacc23eff951050fabc682508f576200a3b1/src/main/resources/net/openhft/chronicle/engine/gui/map.png
--------------------------------------------------------------------------------
/src/main/resources/net/openhft/chronicle/engine/gui/queue.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenHFT/Chronicle-Engine-GUI/3ba5aacc23eff951050fabc682508f576200a3b1/src/main/resources/net/openhft/chronicle/engine/gui/queue.png
--------------------------------------------------------------------------------
/src/main/resources/net/openhft/chronicle/engine/gui/trash.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenHFT/Chronicle-Engine-GUI/3ba5aacc23eff951050fabc682508f576200a3b1/src/main/resources/net/openhft/chronicle/engine/gui/trash.png
--------------------------------------------------------------------------------
/src/main/webapp/VAADIN/themes/mytheme/add.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenHFT/Chronicle-Engine-GUI/3ba5aacc23eff951050fabc682508f576200a3b1/src/main/webapp/VAADIN/themes/mytheme/add.png
--------------------------------------------------------------------------------
/src/main/webapp/VAADIN/themes/mytheme/addons.scss:
--------------------------------------------------------------------------------
1 | /* This file is automatically managed and will be overwritten from time to time. */
2 | /* Do not manually edit this file. */
3 |
4 | /* Import and include this mixin into your project theme to include the addon themes */
5 | @mixin addons {
6 | }
7 |
8 |
--------------------------------------------------------------------------------
/src/main/webapp/VAADIN/themes/mytheme/designs.scss:
--------------------------------------------------------------------------------
1 | // Styles imported from Responsive Application
2 | // Workaround for a https://dev.vaadin.com/ticket/19170 to get hidden icons in some environments to show
3 | #responsive-application-template.valo-menu-responsive .valo-menu-part .valo-menu-item span.v-icon {
4 | opacity: 1.0;
5 | }
6 |
7 |
8 | // Styles imported from NavigationTemplateDark
9 | .root-layout.navigation-template-dark {
10 | $root-background-color: #000;
11 | $template-font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
12 |
13 | $header-bar-background: #323C3C;
14 | $header-bar-font-size: 16px;
15 | $header-bar-text-color: #C8D2D2;
16 |
17 | $search-field-border: 0;
18 | $search-field-bevel: 0;
19 | $search-field-prompt-color: #959595;
20 | $search-field-border-color: #586262;
21 | $username-label-color: #fff;
22 |
23 | $side-bar-background: $header-bar-background;
24 | $menu-button-selected-text-color: #C8D2D2;
25 | $menu-button-selected-background: $root-background-color;
26 | $menu-button-text-color: $menu-button-selected-text-color;
27 | $menu-button-icon-color: $menu-button-selected-text-color;
28 |
29 | background-color: $root-background-color;
30 |
31 | .header-bar .v-nativebutton,
32 | .side-bar .v-nativebutton {
33 | background: none;
34 | border: none;
35 |
36 | &:hover{
37 | cursor: pointer;
38 | }
39 | }
40 |
41 | .scroll-panel {
42 | background-color: $root-background-color;
43 | border: none;
44 | border-radius: 0;
45 | }
46 |
47 | .header-bar {
48 | background-color: $header-bar-background;
49 | padding: 0px 15px 0 15px;
50 | vertical-align: middle;
51 | height: 65px;
52 |
53 | > * {
54 | color: $header-bar-text-color;
55 | float: right;
56 | padding: 0;
57 | line-height: 20px;
58 | margin-left: 15px;
59 | font-size: $header-bar-font-size;
60 | font-family: $template-font-family;
61 |
62 | /** Vertically center everything **/
63 | position: relative;
64 | top: 50%;
65 | -webkit-transform: translateY(-50%);
66 | -ms-transform: translateY(-50%);
67 | transform: translateY(-50%);
68 | }
69 |
70 | > .search-field {
71 | background: none;
72 | color: $search-field-prompt-color;
73 | padding-left: 5px;
74 | box-shadow: none;
75 | border: $search-field-border;
76 | border-bottom: solid 2px $search-field-border-color;
77 | border-radius: 0;
78 | font-style: italic;
79 | }
80 |
81 | .user-name-label {
82 | color: $username-label-color;
83 | }
84 | }
85 |
86 | .side-bar {
87 | background-color: $side-bar-background;
88 | width: 100px;
89 |
90 | > .menu-button {
91 | position: relative;
92 | color: $menu-button-text-color;
93 | height: 90px;
94 |
95 | &.selected{
96 | background-color: $menu-button-selected-background;
97 |
98 | .v-nativebutton-caption {
99 | color: $menu-button-selected-text-color;
100 | }
101 |
102 | }
103 |
104 | .v-nativebutton-caption {
105 | font-family: $template-font-family;
106 | font-size: .7em;
107 | text-transform: uppercase;
108 | position: absolute;
109 | bottom: 8px;
110 | text-align: center;
111 | left: 0;
112 | right: 0;
113 | margin-left: auto;
114 | margin-right: auto;
115 | }
116 |
117 | .v-icon {
118 | color: $menu-button-icon-color;
119 | position: absolute;
120 | font-size: 35px;
121 | margin-left: auto;
122 | margin-right: auto;
123 | top: 10px;
124 | left: 0;
125 | right: 0;
126 | }
127 | }
128 | }
129 |
130 | .dashboard-layout {
131 | padding: 60px 60px 0 60px;
132 | }
133 |
134 | &[width-range~="321px-768px"] {
135 | .dashboard-layout{
136 | padding: 10px;
137 | }
138 |
139 | .dashboard-item {
140 | width: 100% !important;
141 | min-width: 321px;
142 | margin: 0;
143 | }
144 |
145 | .side-bar {
146 | width: 60px;
147 |
148 | > .menu-button{
149 |
150 | height: 50px;
151 |
152 | > .v-nativebutton-caption{
153 | visibility: hidden;
154 | }
155 |
156 | > .v-icon{
157 | top: 0;
158 | }
159 | }
160 | }
161 |
162 | .header-bar {
163 | height: 45px;
164 | padding: 2px;
165 | }
166 | }
167 | }
168 |
169 | .navigation-template-dark[width-range~="321px-768px"] {
170 | visibility: visible;
171 | }
172 |
173 |
--------------------------------------------------------------------------------
/src/main/webapp/VAADIN/themes/mytheme/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenHFT/Chronicle-Engine-GUI/3ba5aacc23eff951050fabc682508f576200a3b1/src/main/webapp/VAADIN/themes/mytheme/favicon.ico
--------------------------------------------------------------------------------
/src/main/webapp/VAADIN/themes/mytheme/mytheme.scss:
--------------------------------------------------------------------------------
1 | // If you edit this file you need to compile the theme. See README.md for details.
2 |
3 | // Global variable overrides. Must be declared before importing Valo.
4 |
5 | // Defines the plaintext font size, weight and family. Font size affects general component sizing.
6 | //$v-font-size: 16px;
7 | //$v-font-weight: 300;
8 | //$v-font-family: "Open Sans", sans-serif;
9 |
10 | // Defines the border used by all components.
11 | //$v-border: 1px solid (v-shade 0.7);
12 | //$v-border-radius: 4px;
13 |
14 | // Affects the color of some component elements, e.g Button, Panel barChartProperties, etc
15 | //$v-background-color: hsl(210, 0%, 98%);
16 | // Affects the color of content areas, e.g Panel and Window content, TextField input etc
17 | //$v-app-background-color: $v-background-color;
18 |
19 | // Affects the visual appearance of all components
20 | //$v-gradient: v-linear 8%;
21 | //$v-bevel-depth: 30%;
22 | //$v-shadow-opacity: 5%;
23 |
24 | // Defines colors for indicating status (focus, success, failure)
25 | //$v-focus-color: valo-focus-color(); // Calculates a suitable color automatically
26 | //$v-friendly-color: #2c9720;
27 | //$v-error-indicator-color: #ed473b;
28 |
29 | // For more information, see: https://vaadin.com/book/-/page/themes.valo.html
30 | // Example variants can be copy/pasted from https://vaadin.com/wiki/-/wiki/Main/Valo+Examples
31 |
32 | @import "../valo/valo.scss";
33 |
34 | @mixin mytheme {
35 | @include valo;
36 |
37 | .myTableStyle .v-icon {
38 | font-size: 30px;
39 | }
40 |
41 | .content{
42 | border-bottom: 1px solid #ccc;
43 | border-right: 1px solid #ccc;
44 | border-left: 1px solid #ccc;
45 | border-top: 1px solid #ccc;
46 | }
47 |
48 |
49 |
50 | // Insert your own theme rules here
51 | }
52 |
--------------------------------------------------------------------------------
/src/main/webapp/VAADIN/themes/mytheme/styles.scss:
--------------------------------------------------------------------------------
1 | @import "designs.scss";
2 | @import "mytheme.scss";
3 | @import "addons.scss";
4 |
5 | // This file prefixes all rules with the theme name to avoid causing conflicts with other themes.
6 | // The actual styles should be defined in mytheme.scss
7 |
8 | .mytheme {
9 | @include addons;
10 | @include mytheme;
11 | }
12 |
13 | .layout-with-border {
14 | border: 1px solid black;
15 | }
16 |
--------------------------------------------------------------------------------
/src/main/webapp/VAADIN/themes/mytheme/trash3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenHFT/Chronicle-Engine-GUI/3ba5aacc23eff951050fabc682508f576200a3b1/src/main/webapp/VAADIN/themes/mytheme/trash3.png
--------------------------------------------------------------------------------