Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,13 @@ java {
targetCompatibility = JavaVersion.VERSION_17
}

repositories { }
repositories {
mavenLocal()
}

dependencies {
implementation project(':SnapKit')
// SnapKit project
implementation 'com.reportmill:snapkit:2026.06'
}

application {
Expand Down
2 changes: 1 addition & 1 deletion src/snapbuild/app/Editor.java
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public Editor()
_contentBox = new BoxView();
_contentBox.setFillWidth(true);
_contentBox.setFillHeight(true);
_contentBox.setFill(ViewUtils.getBackFill());
_contentBox.setFill(ViewThemeUtils.getBackFill());
_contentBox.setFill(BACK_FILL.blend(Color.WHITE, .8));
_contentBox.setBorder(new Color("#99"), 1);
_contentBox.setEffect(new ShadowEffect());
Expand Down
2 changes: 1 addition & 1 deletion src/snapbuild/app/EditorPane.java
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ public void showPreview()
contentCopy.setGrowWidth(false);
contentCopy.setGrowHeight(false);
if (contentCopy.getFill() == null)
contentCopy.setFill(ViewUtils.getBackFill());
contentCopy.setFill(ViewThemeUtils.getBackFill());
contentCopy.setEffect(new ShadowEffect());

// Create BoxView to hold UI
Expand Down
18 changes: 9 additions & 9 deletions src/snapbuild/app/FlatIcon.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package snapbuild.app;
import snap.gfx.Image;
import snap.util.Convert;
import snap.util.JSArray;
import snap.util.JSObject;
import snap.util.JsonArray;
import snap.util.JsonObject;
import snap.web.*;
import java.util.*;

Expand Down Expand Up @@ -50,22 +50,22 @@ public List<FlatIconItem> getImageItemsForSearchString(String aSearchString)
return null;

// Get JSON response
JSObject json = (JSObject) httpResp.getJSON();
JsonObject json = (JsonObject) httpResp.getJSON();
if (json == null)
return null;

// Get metadata, count, total
JSObject metaNode = (JSObject) json.getValue("metadata");
JsonObject metaNode = (JsonObject) json.getValue("metadata");
int count = Convert.intValue(metaNode.getNativeValue("count"));
int total = Convert.intValue(metaNode.getNativeValue("total"));
System.out.println("Found " + count + " of " + total);

// Get data
JSArray dataArrayJS = (JSArray) json.getValue("data");
JsonArray dataArrayJS = (JsonArray) json.getValue("data");

List<FlatIconItem> imageItems = new ArrayList<>();
for (int i = 0; i < count; i++) {
JSObject imageNode = (JSObject) dataArrayJS.getValue(i);
JsonObject imageNode = (JsonObject) dataArrayJS.getValue(i);
FlatIconItem imgItem = new FlatIconItem(imageNode);
imageItems.add(imgItem);
}
Expand Down Expand Up @@ -119,12 +119,12 @@ private static String getToken()
return null;

// Get JSON response
JSObject json = (JSObject) httpResp.getJSON();
JsonObject json = (JsonObject) httpResp.getJSON();
if (json == null)
return null;

// Get data
JSObject dataNode = (JSObject) json.getValue("data");
JsonObject dataNode = (JsonObject) json.getValue("data");
String token = dataNode.getStringValue("token");
//String expires = dataNode.getStringValue("expires");

Expand All @@ -137,7 +137,7 @@ private static String getToken()
private static void addParamsToRequestAsJSON(HTTPRequest httpReq, String... thePairs)
{
// Create JSON Request and add pairs
JSObject jsonReq = new JSObject();
JsonObject jsonReq = new JsonObject();
for (int i = 0; i < thePairs.length; i += 2)
jsonReq.setNativeValue(thePairs[i], thePairs[i + 1]);

Expand Down
18 changes: 9 additions & 9 deletions src/snapbuild/app/FlatIconItem.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
import snap.gfx.Font;
import snap.gfx.Image;
import snap.util.Convert;
import snap.util.JSValue;
import snap.util.JSObject;
import snap.util.JsonNode;
import snap.util.JsonObject;
import snap.view.TextArea;
import snap.view.ViewUtils;
import java.util.LinkedHashMap;
Expand All @@ -17,7 +17,7 @@
public class FlatIconItem {

// The image item node
private JSObject _itemNode;
private JsonObject _itemNode;

// The Id
private int _id;
Expand All @@ -37,7 +37,7 @@ public class FlatIconItem {
/**
* Constructor.
*/
public FlatIconItem(JSObject aNode)
public FlatIconItem(JsonObject aNode)
{
_itemNode = aNode;

Expand All @@ -49,14 +49,14 @@ public FlatIconItem(JSObject aNode)
_desc = _itemNode.getStringValue("description");

// Get images.png node and pngCount
JSObject imagesNode = (JSObject) _itemNode.getValue("images");
JSObject pngNode = imagesNode; //(JSObject) imagesNode.getValue("png");
Map<String, JSValue> keyValues = pngNode.getKeyValues();
JsonObject imagesNode = (JsonObject) _itemNode.getValue("images");
JsonObject pngNode = imagesNode; //(JSObject) imagesNode.getValue("png");
Map<String, JsonNode> keyValues = pngNode.getKeyValues();

// Iterate over PNGs and add to PNG_URLs
for (Map.Entry<String, JSValue> entry : keyValues.entrySet()) {
for (Map.Entry<String, JsonNode> entry : keyValues.entrySet()) {
String key = entry.getKey();
JSValue sizeNode = entry.getValue();
JsonNode sizeNode = entry.getValue();
int size = Convert.intValue(key);
String urls = sizeNode.getValueAsString();
_pngURLs.put(size, urls);
Expand Down
2 changes: 1 addition & 1 deletion src/snapbuild/app/FlatIconPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public class FlatIconPanel extends ViewController {
Consumer<FlatIconItem> _itemSelectedHandler;

// Constants
private static Color ITEM_VIEW_MOUSE_OVER_COLOR = Color.CYAN.blend(ViewUtils.getBackFill().getColor(), .6);
private static Color ITEM_VIEW_MOUSE_OVER_COLOR = Color.CYAN.blend(ViewThemeUtils.getBackFill().getColor(), .6);

/**
* Initialize UI.
Expand Down