├── .github ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── FUNDING.yml ├── dependabot.yml └── workflows │ ├── codeql-analysis.yml │ ├── github.yml │ └── github_pr.yml ├── .gitignore ├── CHANGELOG.md ├── LICENSE ├── README.md ├── build.gradle ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── images ├── Preview2.png ├── legui_api.png └── preview.png ├── intellij-java-style.xml ├── lombok.config ├── pom.xml ├── settings.gradle └── src └── main ├── java └── com │ └── spinyowl │ └── legui │ ├── DefaultInitializer.java │ ├── Version.java │ ├── animation │ ├── Animation.java │ ├── Animator.java │ ├── AnimatorImpl.java │ └── AnimatorProvider.java │ ├── component │ ├── AbstractTextComponent.java │ ├── Button.java │ ├── CheckBox.java │ ├── Component.java │ ├── Dialog.java │ ├── Frame.java │ ├── ImageView.java │ ├── Label.java │ ├── Layer.java │ ├── Panel.java │ ├── PasswordInput.java │ ├── ProgressBar.java │ ├── RadioButton.java │ ├── RadioButtonGroup.java │ ├── ScrollBar.java │ ├── ScrollablePanel.java │ ├── SelectBox.java │ ├── Slider.java │ ├── SplitPanel.java │ ├── TabbedPanel.java │ ├── TextArea.java │ ├── TextAreaField.java │ ├── TextComponent.java │ ├── TextInput.java │ ├── ToggleButton.java │ ├── Tooltip.java │ ├── Viewport.java │ ├── Widget.java │ ├── event │ │ ├── button │ │ │ ├── ButtonContentChangeEvent.java │ │ │ ├── ButtonContentChangeEventListener.java │ │ │ ├── ButtonWidthChangeEvent.java │ │ │ └── ButtonWidthChangeEventListener.java │ │ ├── checkbox │ │ │ ├── CheckBoxChangeValueEvent.java │ │ │ ├── CheckBoxChangeValueEventListener.java │ │ │ ├── CheckBoxWidthChangeEvent.java │ │ │ └── CheckBoxWidthChangeEventListener.java │ │ ├── component │ │ │ ├── ChangePositionEvent.java │ │ │ ├── ChangePositionEventListener.java │ │ │ ├── ChangeSizeEvent.java │ │ │ └── ChangeSizeEventListener.java │ │ ├── label │ │ │ ├── LabelContentChangeEvent.java │ │ │ ├── LabelContentChangeEventListener.java │ │ │ ├── LabelWidthChangeEvent.java │ │ │ └── LabelWidthChangeEventListener.java │ │ ├── scrollbar │ │ │ ├── ScrollBarChangeValueEvent.java │ │ │ └── ScrollBarChangeValueEventListener.java │ │ ├── selectbox │ │ │ ├── SelectBoxChangeSelectionEvent.java │ │ │ └── SelectBoxChangeSelectionEventListener.java │ │ ├── slider │ │ │ ├── SliderChangeValueEvent.java │ │ │ └── SliderChangeValueEventListener.java │ │ ├── textarea │ │ │ ├── TextAreaFieldContentChangeEvent.java │ │ │ ├── TextAreaFieldContentChangeEventListener.java │ │ │ ├── TextAreaFieldHeightChangeEvent.java │ │ │ ├── TextAreaFieldHeightChangeEventListener.java │ │ │ ├── TextAreaFieldUpdateEvent.java │ │ │ ├── TextAreaFieldUpdateEventListener.java │ │ │ ├── TextAreaFieldWidthChangeEvent.java │ │ │ └── TextAreaFieldWidthChangeEventListener.java │ │ ├── textinput │ │ │ ├── TextInputContentChangeEvent.java │ │ │ ├── TextInputContentChangeEventListener.java │ │ │ ├── TextInputWidthChangeEvent.java │ │ │ └── TextInputWidthChangeEventListener.java │ │ ├── tooltip │ │ │ ├── TooltipTextSizeChangeEvent.java │ │ │ └── TooltipTextSizeChangeEventListener.java │ │ └── widget │ │ │ ├── WidgetCloseEvent.java │ │ │ └── WidgetCloseEventListener.java │ ├── misc │ │ ├── animation │ │ │ ├── .gitkeep │ │ │ ├── ViewportAnimation.java │ │ │ ├── scrollablepanel │ │ │ │ └── ScrollablePanelAnimation.java │ │ │ ├── scrollbar │ │ │ │ └── ScrollBarAnimation.java │ │ │ ├── selectbox │ │ │ │ └── SelectBoxAnimation.java │ │ │ └── textarea │ │ │ │ └── TextAreaScrollAnimation.java │ │ └── listener │ │ │ ├── EventUtils.java │ │ │ ├── TextComponentShortcutUtil.java │ │ │ ├── button │ │ │ ├── UpdateButtonStyleWidthListener.java │ │ │ └── UpdateButtonWidthListener.java │ │ │ ├── checkbox │ │ │ └── CheckBoxMouseClickEventListener.java │ │ │ ├── component │ │ │ ├── TabKeyEventListener.java │ │ │ └── TooltipCursorEnterListener.java │ │ │ ├── dialog │ │ │ └── DialogCloseEventListener.java │ │ │ ├── label │ │ │ ├── UpdateLabelStyleWidthListener.java │ │ │ └── UpdateLabelWidthListener.java │ │ │ ├── layercontainer │ │ │ └── LayerContainerWindowSizeEventListener.java │ │ │ ├── radiobutton │ │ │ └── RadioButtonClickEventListener.java │ │ │ ├── scrollablepanel │ │ │ └── ScrollablePanelViewportScrollListener.java │ │ │ ├── scrollbar │ │ │ ├── ScrollBarHelper.java │ │ │ ├── ScrollBarMouseClickEventListener.java │ │ │ ├── ScrollBarMouseDragEventListener.java │ │ │ └── ScrollBarScrollListener.java │ │ │ ├── selectbox │ │ │ ├── SelectBoxClickListener.java │ │ │ ├── SelectBoxElementClickListener.java │ │ │ └── SelectBoxFocusListener.java │ │ │ ├── slider │ │ │ ├── SliderHelper.java │ │ │ ├── SliderMouseClickEventListener.java │ │ │ ├── SliderMouseDragEventListener.java │ │ │ └── SliderScrollEventListener.java │ │ │ ├── splitpanel │ │ │ ├── SplitPanelDragListener.java │ │ │ ├── SplitPanelSeparatorClickListener.java │ │ │ ├── SplitPanelSeparatorCursorEnterListener.java │ │ │ └── SplitPanelSeparatorListenerDelegate.java │ │ │ ├── text │ │ │ ├── CopyTextEventListener.java │ │ │ ├── CutTextEventListener.java │ │ │ ├── PasteTextEventListener.java │ │ │ └── SelectAllTextEventListener.java │ │ │ ├── textarea │ │ │ ├── CutTextAreaKeyboardEventListener.java │ │ │ ├── PasteTextAreaKeyboardEventListener.java │ │ │ ├── TextAreaFieldCharEventListener.java │ │ │ ├── TextAreaFieldDragEventListener.java │ │ │ ├── TextAreaFieldKeyEventListener.java │ │ │ ├── TextAreaFieldMouseClickEventListener.java │ │ │ ├── TextAreaFieldUpdateListener.java │ │ │ └── TextAreaViewportScrollListener.java │ │ │ ├── textinput │ │ │ ├── CutTextInputKeyboardEventListener.java │ │ │ ├── PasteTextInputKeyboardEventListener.java │ │ │ ├── TextInputCharEventListener.java │ │ │ ├── TextInputDragEventListener.java │ │ │ ├── TextInputKeyEventListener.java │ │ │ └── TextInputMouseClickEventListener.java │ │ │ ├── togglebutton │ │ │ └── ToggleButtonMouseClickListener.java │ │ │ └── widget │ │ │ ├── WidgetCloseButMouseClickEventListener.java │ │ │ ├── WidgetDragListener.java │ │ │ ├── WidgetMinimizeButMouseClickEventListener.java │ │ │ └── WidgetResizeButtonDragListener.java │ └── optional │ │ ├── Orientation.java │ │ ├── TextState.java │ │ └── align │ │ ├── HorizontalAlign.java │ │ └── VerticalAlign.java │ ├── config │ └── Configuration.java │ ├── cursor │ ├── Cursor.java │ ├── CursorService.java │ ├── CursorServiceProvider.java │ └── GLFWCursorServiceImpl.java │ ├── demo │ ├── Demo.java │ ├── Example.java │ ├── ExampleGui.java │ ├── FBOImageExample.java │ ├── MultipleWindowsExample.java │ ├── MultipleWindowsMultipleThreadsExample.java │ ├── MultipleWindowsNanoVG.java │ ├── SingleClassExample.java │ ├── SingleClassExample2.java │ ├── SingleClassExampleGuiOverGL.java │ ├── SingleClassExampleImageRendering.java │ ├── WidgetTreeExample.java │ └── layout │ │ ├── BoxLayoutDemo.java │ │ └── MenuLayerDemo.java │ ├── event │ ├── .gitkeep │ ├── AddChildEvent.java │ ├── CharEvent.java │ ├── CursorEnterEvent.java │ ├── DropEvent.java │ ├── Event.java │ ├── FocusEvent.java │ ├── KeyEvent.java │ ├── KeyboardEvent.java │ ├── MouseClickEvent.java │ ├── MouseDragEvent.java │ ├── RemoveChildEvent.java │ ├── ScrollEvent.java │ ├── WindowCloseEvent.java │ ├── WindowFocusEvent.java │ ├── WindowIconifyEvent.java │ ├── WindowPosEvent.java │ ├── WindowRefreshEvent.java │ └── WindowSizeEvent.java │ ├── exception │ ├── .gitkeep │ ├── LeguiException.java │ └── LeguiExceptionTemplate.java │ ├── icon │ ├── CharIcon.java │ ├── Icon.java │ └── ImageIcon.java │ ├── image │ ├── .gitkeep │ ├── BufferedImageRGBA.java │ ├── FBOImage.java │ ├── Image.java │ ├── ImageChannels.java │ ├── LoadableImage.java │ ├── StbBackedLoadableImage.java │ └── loader │ │ ├── DefaultImageLoader.java │ │ └── ImageLoader.java │ ├── input │ ├── KeyAction.java │ ├── KeyCode.java │ ├── KeyMod.java │ ├── Keyboard.java │ ├── KeyboardKey.java │ ├── Mouse.java │ └── Shortcut.java │ ├── intersection │ ├── .gitkeep │ ├── Intersector.java │ └── RectangleIntersector.java │ ├── listener │ ├── .gitkeep │ ├── AddChildEventListener.java │ ├── CharEventListener.java │ ├── CursorEnterEventListener.java │ ├── EventListener.java │ ├── FocusEventListener.java │ ├── KeyEventListener.java │ ├── ListenerMap.java │ ├── MouseClickEventListener.java │ ├── MouseDragEventListener.java │ ├── RemoveChildEventListener.java │ ├── ScrollEventListener.java │ ├── WindowCloseEventListener.java │ ├── WindowFocusEventListener.java │ ├── WindowIconifyEventListener.java │ ├── WindowPosEventListener.java │ ├── WindowRefreshEventListener.java │ ├── WindowSizeEventListener.java │ └── processor │ │ ├── EventProcessor.java │ │ ├── EventProcessorImpl.java │ │ └── EventProcessorProvider.java │ ├── style │ ├── Background.java │ ├── Border.java │ ├── Style.java │ ├── border │ │ ├── .gitkeep │ │ └── SimpleLineBorder.java │ ├── color │ │ ├── .gitkeep │ │ ├── ColorConstants.java │ │ └── ColorUtil.java │ ├── flex │ │ └── FlexStyle.java │ ├── font │ │ ├── .gitkeep │ │ ├── Font.java │ │ ├── FontRegistry.java │ │ └── TextDirection.java │ ├── length │ │ ├── Auto.java │ │ ├── Length.java │ │ ├── LengthType.java │ │ └── Unit.java │ ├── shadow │ │ └── Shadow.java │ └── util │ │ └── StyleUtilities.java │ ├── system │ ├── .gitkeep │ ├── Clipboard.java │ ├── context │ │ ├── .gitkeep │ │ ├── CallbackKeeper.java │ │ ├── Context.java │ │ └── DefaultCallbackKeeper.java │ ├── event │ │ ├── SystemCharEvent.java │ │ ├── SystemCharModsEvent.java │ │ ├── SystemCursorEnterEvent.java │ │ ├── SystemCursorPosEvent.java │ │ ├── SystemDropEvent.java │ │ ├── SystemEvent.java │ │ ├── SystemFramebufferSizeEvent.java │ │ ├── SystemKeyEvent.java │ │ ├── SystemMouseClickEvent.java │ │ ├── SystemScrollEvent.java │ │ ├── SystemWindowCloseEvent.java │ │ ├── SystemWindowFocusEvent.java │ │ ├── SystemWindowIconifyEvent.java │ │ ├── SystemWindowPosEvent.java │ │ ├── SystemWindowRefreshEvent.java │ │ ├── SystemWindowScaleEvent.java │ │ └── SystemWindowSizeEvent.java │ ├── handler │ │ ├── .gitkeep │ │ ├── AbstractSystemEventHandler.java │ │ ├── CharEventHandler.java │ │ ├── CursorPosEventHandler.java │ │ ├── DropEventHandler.java │ │ ├── KeyEventHandler.java │ │ ├── MouseClickEventHandler.java │ │ ├── ScrollEventHandler.java │ │ ├── SehUtil.java │ │ ├── SystemEventHandler.java │ │ ├── SystemEventHandlerProvider.java │ │ ├── WindowCloseEventHandler.java │ │ ├── WindowFocusEventHandler.java │ │ ├── WindowIconifyEventHandler.java │ │ ├── WindowPosEventHandler.java │ │ ├── WindowRefreshEventHandler.java │ │ ├── WindowSizeEventHandler.java │ │ └── processor │ │ │ ├── SystemEventProcessor.java │ │ │ └── SystemEventProcessorImpl.java │ ├── layout │ │ ├── .gitkeep │ │ ├── DefaultLayoutManager.java │ │ ├── Layout.java │ │ ├── LayoutManager.java │ │ └── flex │ │ │ ├── FlexLayout.java │ │ │ └── FlexUtils.java │ └── renderer │ │ ├── .gitkeep │ │ ├── AbstractRenderer.java │ │ ├── BorderRenderer.java │ │ ├── ComponentRenderer.java │ │ ├── IconRenderer.java │ │ ├── ImageRenderer.java │ │ ├── Renderer.java │ │ ├── RendererProvider.java │ │ └── nvg │ │ ├── NvgBorderRenderer.java │ │ ├── NvgComponentRenderer.java │ │ ├── NvgIconRenderer.java │ │ ├── NvgImageReferenceManager.java │ │ ├── NvgImageRenderer.java │ │ ├── NvgRenderer.java │ │ ├── NvgRendererProvider.java │ │ ├── border │ │ ├── NvgDefaultBorderRenderer.java │ │ └── NvgSimpleLineBorderRenderer.java │ │ ├── component │ │ ├── NvgButtonRenderer.java │ │ ├── NvgCheckBoxRenderer.java │ │ ├── NvgDefaultComponentRenderer.java │ │ ├── NvgImageViewRenderer.java │ │ ├── NvgLabelRenderer.java │ │ ├── NvgPasswordInputRenderer.java │ │ ├── NvgProgressBarRenderer.java │ │ ├── NvgRadioButtonRenderer.java │ │ ├── NvgScrollBarRenderer.java │ │ ├── NvgSliderRenderer.java │ │ ├── NvgTextAreaFieldRenderer.java │ │ ├── NvgTextInputRenderer.java │ │ ├── NvgToggleButtonRenderer.java │ │ └── NvgTooltipRenderer.java │ │ ├── icon │ │ ├── NvgCharIconRenderer.java │ │ ├── NvgDefaultIconRenderer.java │ │ └── NvgImageIconRenderer.java │ │ ├── image │ │ ├── NvgBufferedImageRGBARenderer.java │ │ ├── NvgDefaultImageRenderer.java │ │ ├── NvgFBOImageRenderer.java │ │ └── NvgStbBackedLoadableImageRenderer.java │ │ └── util │ │ ├── NvgColorUtil.java │ │ ├── NvgRenderUtils.java │ │ ├── NvgShapes.java │ │ └── NvgText.java │ ├── theme │ ├── AbstractTheme.java │ ├── DefaultThemeManager.java │ ├── Theme.java │ ├── ThemeManager.java │ ├── Themes.java │ └── colored │ │ ├── FlatColoredTheme.java │ │ └── def │ │ ├── FlatBorderlessTransparentTheme.java │ │ ├── FlatButtonTheme.java │ │ ├── FlatCheckBoxTheme.java │ │ ├── FlatComponentTheme.java │ │ ├── FlatLabelTheme.java │ │ ├── FlatLayerTheme.java │ │ ├── FlatPanelTheme.java │ │ ├── FlatProgressBarTheme.java │ │ ├── FlatRadioButtonTheme.java │ │ ├── FlatScrollBarTheme.java │ │ ├── FlatScrollablePanelTheme.java │ │ ├── FlatSelectBoxElementTheme.java │ │ ├── FlatSelectBoxScrollablePanelTheme.java │ │ ├── FlatSelectBoxTheme.java │ │ ├── FlatSliderTheme.java │ │ ├── FlatTextAreaFieldTheme.java │ │ ├── FlatTextAreaTheme.java │ │ ├── FlatTextInputTheme.java │ │ ├── FlatToggleButtonTheme.java │ │ ├── FlatTooltipTheme.java │ │ └── FlatWidgetTheme.java │ └── util │ ├── IOUtil.java │ ├── TextUtil.java │ └── Utilites.java └── resources ├── com └── spinyowl │ └── legui │ ├── demo │ ├── 1.jpg │ ├── 1.png │ ├── 2.jpg │ ├── 2.png │ ├── 3.png │ ├── json.json │ ├── normal.png │ ├── toggle.png │ └── toggled.png │ ├── style │ └── font │ │ ├── FontAwesome.otf │ │ ├── MaterialIcons-Regular.ttf │ │ ├── NotoEmoji-Regular.ttf │ │ ├── Roboto-Bold.ttf │ │ ├── Roboto-Light.ttf │ │ ├── Roboto-Regular.ttf │ │ ├── entypo.ttf │ │ └── materialdesignicons.ttf │ └── version.properties └── defaultLegui.json /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | ko_fi: SpinyOwl 2 | custom: [paypal.me/shchalexander] 3 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | # To get started with Dependabot version updates, you'll need to specify which 2 | # package ecosystems to update and where the package manifests are located. 3 | # Please see the documentation for all configuration options: 4 | # https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates 5 | 6 | version: 2 7 | updates: 8 | - package-ecosystem: "github-actions" 9 | directory: "/" 10 | schedule: 11 | interval: "weekly" 12 | 13 | - package-ecosystem: gradle 14 | directory: "/" 15 | schedule: 16 | interval: weekly 17 | open-pull-requests-limit: 10 18 | 19 | -------------------------------------------------------------------------------- /.github/workflows/github_pr.yml: -------------------------------------------------------------------------------- 1 | name: Build and check PR 2 | 3 | on: 4 | pull_request: 5 | branches: 6 | - develop 7 | 8 | jobs: 9 | build: 10 | name: Build PR for LEGUI 11 | runs-on: ubuntu-latest 12 | steps: 13 | # CHECKOUT 14 | - uses: actions/checkout@v4 15 | 16 | # PREPARE AND BUILD 17 | - name: Set up JDK 18 | uses: actions/setup-java@v4 19 | with: 20 | java-version: 17 21 | distribution: 'temurin' 22 | cache: 'gradle' 23 | 24 | - name: Build with Gradle 25 | run: ./gradlew build 26 | 27 | # RUN TESTS 28 | - name: Run tests 29 | run: ./gradlew test 30 | 31 | # RUN TESTS 32 | - name: Run tests 33 | run: ./gradlew test 34 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /.idea/ 2 | /build/ 3 | /target/ 4 | /.gradle/ 5 | /classes/ 6 | /out/ 7 | hs_err_pid* 8 | /logs/ 9 | 10 | *.class 11 | *.iml 12 | /bin/ 13 | 14 | .classpath 15 | .project 16 | /.settings/ 17 | /deploy_rsa 18 | /deploy_rsa.pub 19 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Spiny Owl 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | version=4.2.1 2 | commons_version=3.17.0 3 | guava_version=33.4.8-jre 4 | json_io_version=4.13.0 5 | moshi_version=1.15.2 6 | 7 | lombok_version=1.18.38 8 | joml_version=1.10.8 9 | lwjgl_version=3.3.6 10 | cbchain_version=1.0.2 -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpinyOwl/legui/2548498b737dd9b193a87404081a76d01266b883/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.1-bin.zip 4 | networkTimeout=10000 5 | zipStoreBase=GRADLE_USER_HOME 6 | zipStorePath=wrapper/dists 7 | -------------------------------------------------------------------------------- /images/Preview2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpinyOwl/legui/2548498b737dd9b193a87404081a76d01266b883/images/Preview2.png -------------------------------------------------------------------------------- /images/legui_api.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpinyOwl/legui/2548498b737dd9b193a87404081a76d01266b883/images/legui_api.png -------------------------------------------------------------------------------- /images/preview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SpinyOwl/legui/2548498b737dd9b193a87404081a76d01266b883/images/preview.png -------------------------------------------------------------------------------- /lombok.config: -------------------------------------------------------------------------------- 1 | lombok.accessors.chain=false 2 | 3 | lombok.equalsandhashcode.callsuper=call 4 | lombok.tostring.callsuper=call 5 | -------------------------------------------------------------------------------- /pom.xml: -------------------------------------------------------------------------------- 1 | 4 | 9 | legui 10 | 11 | The LEGUI library. 12 | 13 | 14 | shchalexander@gmail.com 15 | ShchAlexander 16 | Aliaksandr Shcherbin 17 | 18 | 19 | 20 | com.spinyowl 21 | 22 | 23 | 24 | repo 25 | MIT License 26 | https://github.com/SpinyOwl/legui/blob/develop/LICENSE 27 | 28 | 29 | 4.0.0 30 | LEGUI 31 | 32 | 33 | scm:git:https://github.com/SpinyOwl/legui.git 34 | scm:git:https://github.com/SpinyOwl/legui.git 35 | https://github.com/SpinyOwl/legui.git 36 | 37 | 38 | https://github.com/SpinyOwl/legui 39 | 40 | 2.2.2 41 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'legui' 2 | 3 | -------------------------------------------------------------------------------- /src/main/java/com/spinyowl/legui/animation/Animation.java: -------------------------------------------------------------------------------- 1 | package com.spinyowl.legui.animation; 2 | 3 | /** 4 | * Draft animation realization. 5 | */ 6 | public abstract class Animation { 7 | 8 | /** 9 | * Flag that indicates if animation was started. 10 | */ 11 | private boolean animationStarted = false; 12 | 13 | /** 14 | * Adds animation to animator. 15 | */ 16 | public void startAnimation() { 17 | if (!animationStarted) { 18 | AnimatorProvider.getAnimator().pushAnimation(this); 19 | animationStarted = true; 20 | } 21 | } 22 | 23 | /** 24 | * Called one time before animate loop. 25 | */ 26 | protected void beforeAnimation() { 27 | // Could be implemented later. 28 | } 29 | 30 | /** 31 | * This method used to update animated object. Called by animator every frame. Removed from 32 | * animator and stops when this method returns true.

Returns true if animation is finished and 33 | * could be removed from animator. 34 | * 35 | * @param delta delta time (from previous call). 36 | * @return true if animation is finished and could be removed from animator. 37 | */ 38 | protected abstract boolean animate(double delta); 39 | 40 | /** 41 | * Called one time when animation ended. 42 | */ 43 | protected void afterAnimation() { 44 | // Could be implemented later. 45 | } 46 | 47 | /** 48 | * Used to stop animation. Removes animation from animator. 49 | */ 50 | public void stopAnimation() { 51 | AnimatorProvider.getAnimator().removeAnimation(this); 52 | } 53 | 54 | /** 55 | * Returns the flag that indicates if animation was started. 56 | * 57 | * @return the flag that indicates if animation was started. 58 | */ 59 | public boolean isAnimationStarted() { 60 | return animationStarted; 61 | } 62 | 63 | } 64 | -------------------------------------------------------------------------------- /src/main/java/com/spinyowl/legui/animation/Animator.java: -------------------------------------------------------------------------------- 1 | package com.spinyowl.legui.animation; 2 | 3 | /** 4 | * Animation processor.. 5 | */ 6 | public interface Animator { 7 | 8 | /** 9 | * This method used to process animations. 10 | */ 11 | void runAnimations(); 12 | 13 | /** 14 | * Used to add animation to animator. 15 | * 16 | * @param animation animation to add. 17 | */ 18 | void pushAnimation(Animation animation); 19 | 20 | /** 21 | * Used to remove animation from animator. In case if animation is not finished animation still 22 | * should be removed and terminated. 23 | * 24 | * @param animation animation to remove. 25 | */ 26 | void removeAnimation(Animation animation); 27 | 28 | 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/com/spinyowl/legui/animation/AnimatorProvider.java: -------------------------------------------------------------------------------- 1 | package com.spinyowl.legui.animation; 2 | 3 | /** 4 | * Animation processor.. 5 | */ 6 | public final class AnimatorProvider { 7 | 8 | /** 9 | * Default animator of animator. 10 | */ 11 | private static Animator animator = new AnimatorImpl(); 12 | 13 | private AnimatorProvider() { 14 | } 15 | 16 | /** 17 | * Gets animator. 18 | * 19 | * @return the animator 20 | */ 21 | public static Animator getAnimator() { 22 | return AnimatorProvider.animator; 23 | } 24 | 25 | /** 26 | * Sets animator. 27 | * 28 | * @param animator the animator. 29 | */ 30 | public static void setAnimator(Animator animator) { 31 | if (animator != null) { 32 | AnimatorProvider.animator = animator; 33 | } 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/com/spinyowl/legui/component/AbstractTextComponent.java: -------------------------------------------------------------------------------- 1 | package com.spinyowl.legui.component; 2 | 3 | import com.spinyowl.legui.component.optional.TextState; 4 | import java.util.Objects; 5 | import org.joml.Vector2f; 6 | 7 | public abstract class AbstractTextComponent extends Component implements TextComponent { 8 | 9 | protected TextState textState; 10 | 11 | /** 12 | * Default constructor. Used to create component instance without any parameters. 13 | *

14 | * Also if you want to make it easy to use with Json marshaller/unmarshaller component should 15 | * contain empty constructor. 16 | */ 17 | public AbstractTextComponent() { 18 | } 19 | 20 | /** 21 | * Constructor with position and size parameters. 22 | * 23 | * @param x x position position in parent component. 24 | * @param y y position position in parent component. 25 | * @param width width of component. 26 | * @param height height of component. 27 | */ 28 | public AbstractTextComponent(float x, float y, float width, float height) { 29 | super(x, y, width, height); 30 | } 31 | 32 | /** 33 | * Constructor with position and size parameters. 34 | * 35 | * @param position position position in parent component. 36 | * @param size size of component. 37 | */ 38 | public AbstractTextComponent(Vector2f position, Vector2f size) { 39 | super(position, size); 40 | } 41 | 42 | @Override 43 | public TextState getTextState() { 44 | return textState; 45 | } 46 | 47 | @Override 48 | public void setTextState(TextState textState) { 49 | this.textState = Objects.requireNonNull(textState); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/main/java/com/spinyowl/legui/component/Panel.java: -------------------------------------------------------------------------------- 1 | package com.spinyowl.legui.component; 2 | 3 | import com.spinyowl.legui.theme.Themes; 4 | import org.joml.Vector2f; 5 | 6 | /** 7 | * Default Container implementation. Used to hold components. 8 | */ 9 | public class Panel extends Component { 10 | 11 | /** 12 | * Default constructor. Used to create component instance without any parameters.

Also if you 13 | * want to make it easy to use with Json marshaller/unmarshaller component should contain empty 14 | * constructor. 15 | */ 16 | public Panel() { 17 | Themes.getDefaultTheme().applyAll(this); 18 | } 19 | 20 | /** 21 | * Constructor with position and size parameters. 22 | * 23 | * @param x x position position in parent component. 24 | * @param y y position position in parent component. 25 | * @param width width of component. 26 | * @param height height of component. 27 | */ 28 | public Panel(float x, float y, float width, float height) { 29 | super(x, y, width, height); 30 | Themes.getDefaultTheme().applyAll(this); 31 | } 32 | 33 | /** 34 | * Constructor with position and size parameters. 35 | * 36 | * @param position position position in parent component. 37 | * @param size size of component. 38 | */ 39 | public Panel(Vector2f position, Vector2f size) { 40 | super(position, size); 41 | Themes.getDefaultTheme().applyAll(this); 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /src/main/java/com/spinyowl/legui/component/TextComponent.java: -------------------------------------------------------------------------------- 1 | package com.spinyowl.legui.component; 2 | 3 | import com.spinyowl.legui.component.optional.TextState; 4 | 5 | public interface TextComponent { 6 | 7 | /** 8 | * Returns current text state. 9 | * 10 | * @return text state of component. 11 | */ 12 | TextState getTextState(); 13 | 14 | /** 15 | * Used to set text state 16 | * 17 | * @param textState new text state to set. 18 | * @throws NullPointerException in case if textState is null. 19 | */ 20 | void setTextState(TextState textState) throws NullPointerException; 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/com/spinyowl/legui/component/Viewport.java: -------------------------------------------------------------------------------- 1 | package com.spinyowl.legui.component; 2 | 3 | import org.joml.Vector2f; 4 | 5 | 6 | public interface Viewport { 7 | 8 | Vector2f getViewportSize(); 9 | 10 | Vector2f getViewportViewSize(); 11 | 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/com/spinyowl/legui/component/event/button/ButtonContentChangeEventListener.java: -------------------------------------------------------------------------------- 1 | package com.spinyowl.legui.component.event.button; 2 | 3 | import com.spinyowl.legui.listener.EventListener; 4 | 5 | 6 | public interface ButtonContentChangeEventListener extends EventListener { 7 | 8 | /** 9 | * Used to handle {@link ButtonContentChangeEvent} event. 10 | * 11 | * @param event event to handle. 12 | */ 13 | @Override 14 | void process(ButtonContentChangeEvent event); 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/spinyowl/legui/component/event/button/ButtonWidthChangeEvent.java: -------------------------------------------------------------------------------- 1 | package com.spinyowl.legui.component.event.button; 2 | 3 | import com.spinyowl.legui.component.Button; 4 | import com.spinyowl.legui.component.Frame; 5 | import com.spinyowl.legui.event.Event; 6 | import com.spinyowl.legui.system.context.Context; 7 | import java.util.Objects; 8 | import org.apache.commons.lang3.builder.ToStringBuilder; 9 | 10 | public class ButtonWidthChangeEvent extends Event