Skip to content

Commit

Permalink
[Build] Remove lomok from imgui-app
Browse files Browse the repository at this point in the history
  • Loading branch information
SpaiR committed May 29, 2021
1 parent 423612c commit 93f8a11
Show file tree
Hide file tree
Showing 6 changed files with 64 additions and 13 deletions.
1 change: 1 addition & 0 deletions config/checkstyle/suppressions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@
<suppress checks="ParameterNumber" files="[\\/]imgui[\\/]"/>
<suppress checks="FileLength" files="[\\/]imgui[\\/]"/>
<suppress checks="FinalParameters" files="ImGui.java"/>
<suppress checks="DesignForExtension" files="[\\/]imgui[\\/]app[\\/]"/>
</suppressions>
1 change: 0 additions & 1 deletion imgui-app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
plugins {
id 'java-library'
id 'io.freefair.lombok' version '6.0.0-m2'
id 'checkstyle'
id 'maven-publish'
id 'signing'
Expand Down
2 changes: 0 additions & 2 deletions imgui-app/lombok.config

This file was deleted.

32 changes: 28 additions & 4 deletions imgui-app/src/main/java/imgui/app/Color.java
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
package imgui.app;

import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.Arrays;

/**
* Object for color data.
*/
@Data
@NoArgsConstructor
public class Color implements Cloneable {
private final float[] data = new float[4];

public Color() {
}

public Color(final float[] color) {
set(color);
}
Expand Down Expand Up @@ -49,6 +49,30 @@ public final float getAlpha() {
return data[3];
}

@Override
public boolean equals(final Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
final Color color = (Color) o;
return Arrays.equals(data, color.data);
}

@Override
public int hashCode() {
return Arrays.hashCode(data);
}

@Override
public String toString() {
return "Color{"
+ "data=" + Arrays.toString(data)
+ '}';
}

/**
* Method to clone Color instance.
*
Expand Down
35 changes: 32 additions & 3 deletions imgui-app/src/main/java/imgui/app/Configuration.java
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
package imgui.app;

import lombok.Data;

/**
* Data class to provide basic information about the window. Like, the title name etc.
*/
@Data
public class Configuration {
/**
* Application title.
Expand All @@ -23,4 +20,36 @@ public class Configuration {
* When true, application will be maximized by default.
*/
private boolean fullScreen = false;

public String getTitle() {
return title;
}

public void setTitle(final String title) {
this.title = title;
}

public int getWidth() {
return width;
}

public void setWidth(final int width) {
this.width = width;
}

public int getHeight() {
return height;
}

public void setHeight(final int height) {
this.height = height;
}

public boolean isFullScreen() {
return fullScreen;
}

public void setFullScreen(final boolean fullScreen) {
this.fullScreen = fullScreen;
}
}
6 changes: 3 additions & 3 deletions imgui-app/src/main/java/imgui/app/Window.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public abstract class Window {
*
* @param config configuration object with basic window information
*/
protected final void init(final Configuration config) {
protected void init(final Configuration config) {
initWindow(config);
initImGui(config);
imGuiGlfw.init(handle, true);
Expand All @@ -52,7 +52,7 @@ protected final void init(final Configuration config) {
/**
* Method to dispose all used application resources and destroy its window.
*/
protected final void dispose() {
protected void dispose() {
imGuiGl3.dispose();
imGuiGlfw.dispose();
disposeImGui();
Expand Down Expand Up @@ -139,7 +139,7 @@ protected void postProcess() {
/**
* Main application loop.
*/
protected final void run() {
protected void run() {
while (!GLFW.glfwWindowShouldClose(handle)) {
startFrame();
preProcess();
Expand Down

0 comments on commit 93f8a11

Please sign in to comment.