Delete Admin directory
This commit is contained in:
@@ -1 +0,0 @@
|
||||
|
||||
Vendored
-316
@@ -1,316 +0,0 @@
|
||||
#!/bin/sh
|
||||
# ----------------------------------------------------------------------------
|
||||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# https://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
# ----------------------------------------------------------------------------
|
||||
|
||||
# ----------------------------------------------------------------------------
|
||||
# Maven Start Up Batch script
|
||||
#
|
||||
# Required ENV vars:
|
||||
# ------------------
|
||||
# JAVA_HOME - location of a JDK home dir
|
||||
#
|
||||
# Optional ENV vars
|
||||
# -----------------
|
||||
# M2_HOME - location of maven2's installed home dir
|
||||
# MAVEN_OPTS - parameters passed to the Java VM when running Maven
|
||||
# e.g. to debug Maven itself, use
|
||||
# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
|
||||
# MAVEN_SKIP_RC - flag to disable loading of mavenrc files
|
||||
# ----------------------------------------------------------------------------
|
||||
|
||||
if [ -z "$MAVEN_SKIP_RC" ] ; then
|
||||
|
||||
if [ -f /usr/local/etc/mavenrc ] ; then
|
||||
. /usr/local/etc/mavenrc
|
||||
fi
|
||||
|
||||
if [ -f /etc/mavenrc ] ; then
|
||||
. /etc/mavenrc
|
||||
fi
|
||||
|
||||
if [ -f "$HOME/.mavenrc" ] ; then
|
||||
. "$HOME/.mavenrc"
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
# OS specific support. $var _must_ be set to either true or false.
|
||||
cygwin=false;
|
||||
darwin=false;
|
||||
mingw=false
|
||||
case "`uname`" in
|
||||
CYGWIN*) cygwin=true ;;
|
||||
MINGW*) mingw=true;;
|
||||
Darwin*) darwin=true
|
||||
# Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home
|
||||
# See https://developer.apple.com/library/mac/qa/qa1170/_index.html
|
||||
if [ -z "$JAVA_HOME" ]; then
|
||||
if [ -x "/usr/libexec/java_home" ]; then
|
||||
export JAVA_HOME="`/usr/libexec/java_home`"
|
||||
else
|
||||
export JAVA_HOME="/Library/Java/Home"
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ -z "$JAVA_HOME" ] ; then
|
||||
if [ -r /etc/gentoo-release ] ; then
|
||||
JAVA_HOME=`java-config --jre-home`
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -z "$M2_HOME" ] ; then
|
||||
## resolve links - $0 may be a link to maven's home
|
||||
PRG="$0"
|
||||
|
||||
# need this for relative symlinks
|
||||
while [ -h "$PRG" ] ; do
|
||||
ls=`ls -ld "$PRG"`
|
||||
link=`expr "$ls" : '.*-> \(.*\)$'`
|
||||
if expr "$link" : '/.*' > /dev/null; then
|
||||
PRG="$link"
|
||||
else
|
||||
PRG="`dirname "$PRG"`/$link"
|
||||
fi
|
||||
done
|
||||
|
||||
saveddir=`pwd`
|
||||
|
||||
M2_HOME=`dirname "$PRG"`/..
|
||||
|
||||
# make it fully qualified
|
||||
M2_HOME=`cd "$M2_HOME" && pwd`
|
||||
|
||||
cd "$saveddir"
|
||||
# echo Using m2 at $M2_HOME
|
||||
fi
|
||||
|
||||
# For Cygwin, ensure paths are in UNIX format before anything is touched
|
||||
if $cygwin ; then
|
||||
[ -n "$M2_HOME" ] &&
|
||||
M2_HOME=`cygpath --unix "$M2_HOME"`
|
||||
[ -n "$JAVA_HOME" ] &&
|
||||
JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
|
||||
[ -n "$CLASSPATH" ] &&
|
||||
CLASSPATH=`cygpath --path --unix "$CLASSPATH"`
|
||||
fi
|
||||
|
||||
# For Mingw, ensure paths are in UNIX format before anything is touched
|
||||
if $mingw ; then
|
||||
[ -n "$M2_HOME" ] &&
|
||||
M2_HOME="`(cd "$M2_HOME"; pwd)`"
|
||||
[ -n "$JAVA_HOME" ] &&
|
||||
JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`"
|
||||
fi
|
||||
|
||||
if [ -z "$JAVA_HOME" ]; then
|
||||
javaExecutable="`which javac`"
|
||||
if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then
|
||||
# readlink(1) is not available as standard on Solaris 10.
|
||||
readLink=`which readlink`
|
||||
if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then
|
||||
if $darwin ; then
|
||||
javaHome="`dirname \"$javaExecutable\"`"
|
||||
javaExecutable="`cd \"$javaHome\" && pwd -P`/javac"
|
||||
else
|
||||
javaExecutable="`readlink -f \"$javaExecutable\"`"
|
||||
fi
|
||||
javaHome="`dirname \"$javaExecutable\"`"
|
||||
javaHome=`expr "$javaHome" : '\(.*\)/bin'`
|
||||
JAVA_HOME="$javaHome"
|
||||
export JAVA_HOME
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -z "$JAVACMD" ] ; then
|
||||
if [ -n "$JAVA_HOME" ] ; then
|
||||
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
||||
# IBM's JDK on AIX uses strange locations for the executables
|
||||
JAVACMD="$JAVA_HOME/jre/sh/java"
|
||||
else
|
||||
JAVACMD="$JAVA_HOME/bin/java"
|
||||
fi
|
||||
else
|
||||
JAVACMD="`\\unset -f command; \\command -v java`"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ ! -x "$JAVACMD" ] ; then
|
||||
echo "Error: JAVA_HOME is not defined correctly." >&2
|
||||
echo " We cannot execute $JAVACMD" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -z "$JAVA_HOME" ] ; then
|
||||
echo "Warning: JAVA_HOME environment variable is not set."
|
||||
fi
|
||||
|
||||
CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher
|
||||
|
||||
# traverses directory structure from process work directory to filesystem root
|
||||
# first directory with .mvn subdirectory is considered project base directory
|
||||
find_maven_basedir() {
|
||||
|
||||
if [ -z "$1" ]
|
||||
then
|
||||
echo "Path not specified to find_maven_basedir"
|
||||
return 1
|
||||
fi
|
||||
|
||||
basedir="$1"
|
||||
wdir="$1"
|
||||
while [ "$wdir" != '/' ] ; do
|
||||
if [ -d "$wdir"/.mvn ] ; then
|
||||
basedir=$wdir
|
||||
break
|
||||
fi
|
||||
# workaround for JBEAP-8937 (on Solaris 10/Sparc)
|
||||
if [ -d "${wdir}" ]; then
|
||||
wdir=`cd "$wdir/.."; pwd`
|
||||
fi
|
||||
# end of workaround
|
||||
done
|
||||
echo "${basedir}"
|
||||
}
|
||||
|
||||
# concatenates all lines of a file
|
||||
concat_lines() {
|
||||
if [ -f "$1" ]; then
|
||||
echo "$(tr -s '\n' ' ' < "$1")"
|
||||
fi
|
||||
}
|
||||
|
||||
BASE_DIR=`find_maven_basedir "$(pwd)"`
|
||||
if [ -z "$BASE_DIR" ]; then
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
##########################################################################################
|
||||
# Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
|
||||
# This allows using the maven wrapper in projects that prohibit checking in binary data.
|
||||
##########################################################################################
|
||||
if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then
|
||||
if [ "$MVNW_VERBOSE" = true ]; then
|
||||
echo "Found .mvn/wrapper/maven-wrapper.jar"
|
||||
fi
|
||||
else
|
||||
if [ "$MVNW_VERBOSE" = true ]; then
|
||||
echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..."
|
||||
fi
|
||||
if [ -n "$MVNW_REPOURL" ]; then
|
||||
jarUrl="$MVNW_REPOURL/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar"
|
||||
else
|
||||
jarUrl="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar"
|
||||
fi
|
||||
while IFS="=" read key value; do
|
||||
case "$key" in (wrapperUrl) jarUrl="$value"; break ;;
|
||||
esac
|
||||
done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties"
|
||||
if [ "$MVNW_VERBOSE" = true ]; then
|
||||
echo "Downloading from: $jarUrl"
|
||||
fi
|
||||
wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar"
|
||||
if $cygwin; then
|
||||
wrapperJarPath=`cygpath --path --windows "$wrapperJarPath"`
|
||||
fi
|
||||
|
||||
if command -v wget > /dev/null; then
|
||||
if [ "$MVNW_VERBOSE" = true ]; then
|
||||
echo "Found wget ... using wget"
|
||||
fi
|
||||
if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
|
||||
wget "$jarUrl" -O "$wrapperJarPath" || rm -f "$wrapperJarPath"
|
||||
else
|
||||
wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath" || rm -f "$wrapperJarPath"
|
||||
fi
|
||||
elif command -v curl > /dev/null; then
|
||||
if [ "$MVNW_VERBOSE" = true ]; then
|
||||
echo "Found curl ... using curl"
|
||||
fi
|
||||
if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
|
||||
curl -o "$wrapperJarPath" "$jarUrl" -f
|
||||
else
|
||||
curl --user $MVNW_USERNAME:$MVNW_PASSWORD -o "$wrapperJarPath" "$jarUrl" -f
|
||||
fi
|
||||
|
||||
else
|
||||
if [ "$MVNW_VERBOSE" = true ]; then
|
||||
echo "Falling back to using Java to download"
|
||||
fi
|
||||
javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java"
|
||||
# For Cygwin, switch paths to Windows format before running javac
|
||||
if $cygwin; then
|
||||
javaClass=`cygpath --path --windows "$javaClass"`
|
||||
fi
|
||||
if [ -e "$javaClass" ]; then
|
||||
if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
|
||||
if [ "$MVNW_VERBOSE" = true ]; then
|
||||
echo " - Compiling MavenWrapperDownloader.java ..."
|
||||
fi
|
||||
# Compiling the Java class
|
||||
("$JAVA_HOME/bin/javac" "$javaClass")
|
||||
fi
|
||||
if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
|
||||
# Running the downloader
|
||||
if [ "$MVNW_VERBOSE" = true ]; then
|
||||
echo " - Running MavenWrapperDownloader.java ..."
|
||||
fi
|
||||
("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR")
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
##########################################################################################
|
||||
# End of extension
|
||||
##########################################################################################
|
||||
|
||||
export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"}
|
||||
if [ "$MVNW_VERBOSE" = true ]; then
|
||||
echo $MAVEN_PROJECTBASEDIR
|
||||
fi
|
||||
MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS"
|
||||
|
||||
# For Cygwin, switch paths to Windows format before running java
|
||||
if $cygwin; then
|
||||
[ -n "$M2_HOME" ] &&
|
||||
M2_HOME=`cygpath --path --windows "$M2_HOME"`
|
||||
[ -n "$JAVA_HOME" ] &&
|
||||
JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"`
|
||||
[ -n "$CLASSPATH" ] &&
|
||||
CLASSPATH=`cygpath --path --windows "$CLASSPATH"`
|
||||
[ -n "$MAVEN_PROJECTBASEDIR" ] &&
|
||||
MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"`
|
||||
fi
|
||||
|
||||
# Provide a "standardized" way to retrieve the CLI args that will
|
||||
# work with both Windows and non-Windows executions.
|
||||
MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@"
|
||||
export MAVEN_CMD_LINE_ARGS
|
||||
|
||||
WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
|
||||
|
||||
exec "$JAVACMD" \
|
||||
$MAVEN_OPTS \
|
||||
$MAVEN_DEBUG_OPTS \
|
||||
-classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \
|
||||
"-Dmaven.home=${M2_HOME}" \
|
||||
"-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
|
||||
${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@"
|
||||
Vendored
-188
@@ -1,188 +0,0 @@
|
||||
@REM ----------------------------------------------------------------------------
|
||||
@REM Licensed to the Apache Software Foundation (ASF) under one
|
||||
@REM or more contributor license agreements. See the NOTICE file
|
||||
@REM distributed with this work for additional information
|
||||
@REM regarding copyright ownership. The ASF licenses this file
|
||||
@REM to you under the Apache License, Version 2.0 (the
|
||||
@REM "License"); you may not use this file except in compliance
|
||||
@REM with the License. You may obtain a copy of the License at
|
||||
@REM
|
||||
@REM https://www.apache.org/licenses/LICENSE-2.0
|
||||
@REM
|
||||
@REM Unless required by applicable law or agreed to in writing,
|
||||
@REM software distributed under the License is distributed on an
|
||||
@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
@REM KIND, either express or implied. See the License for the
|
||||
@REM specific language governing permissions and limitations
|
||||
@REM under the License.
|
||||
@REM ----------------------------------------------------------------------------
|
||||
|
||||
@REM ----------------------------------------------------------------------------
|
||||
@REM Maven Start Up Batch script
|
||||
@REM
|
||||
@REM Required ENV vars:
|
||||
@REM JAVA_HOME - location of a JDK home dir
|
||||
@REM
|
||||
@REM Optional ENV vars
|
||||
@REM M2_HOME - location of maven2's installed home dir
|
||||
@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands
|
||||
@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending
|
||||
@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven
|
||||
@REM e.g. to debug Maven itself, use
|
||||
@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
|
||||
@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files
|
||||
@REM ----------------------------------------------------------------------------
|
||||
|
||||
@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on'
|
||||
@echo off
|
||||
@REM set title of command window
|
||||
title %0
|
||||
@REM enable echoing by setting MAVEN_BATCH_ECHO to 'on'
|
||||
@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO%
|
||||
|
||||
@REM set %HOME% to equivalent of $HOME
|
||||
if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%")
|
||||
|
||||
@REM Execute a user defined script before this one
|
||||
if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre
|
||||
@REM check for pre script, once with legacy .bat ending and once with .cmd ending
|
||||
if exist "%USERPROFILE%\mavenrc_pre.bat" call "%USERPROFILE%\mavenrc_pre.bat" %*
|
||||
if exist "%USERPROFILE%\mavenrc_pre.cmd" call "%USERPROFILE%\mavenrc_pre.cmd" %*
|
||||
:skipRcPre
|
||||
|
||||
@setlocal
|
||||
|
||||
set ERROR_CODE=0
|
||||
|
||||
@REM To isolate internal variables from possible post scripts, we use another setlocal
|
||||
@setlocal
|
||||
|
||||
@REM ==== START VALIDATION ====
|
||||
if not "%JAVA_HOME%" == "" goto OkJHome
|
||||
|
||||
echo.
|
||||
echo Error: JAVA_HOME not found in your environment. >&2
|
||||
echo Please set the JAVA_HOME variable in your environment to match the >&2
|
||||
echo location of your Java installation. >&2
|
||||
echo.
|
||||
goto error
|
||||
|
||||
:OkJHome
|
||||
if exist "%JAVA_HOME%\bin\java.exe" goto init
|
||||
|
||||
echo.
|
||||
echo Error: JAVA_HOME is set to an invalid directory. >&2
|
||||
echo JAVA_HOME = "%JAVA_HOME%" >&2
|
||||
echo Please set the JAVA_HOME variable in your environment to match the >&2
|
||||
echo location of your Java installation. >&2
|
||||
echo.
|
||||
goto error
|
||||
|
||||
@REM ==== END VALIDATION ====
|
||||
|
||||
:init
|
||||
|
||||
@REM Find the project base dir, i.e. the directory that contains the folder ".mvn".
|
||||
@REM Fallback to current working directory if not found.
|
||||
|
||||
set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR%
|
||||
IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir
|
||||
|
||||
set EXEC_DIR=%CD%
|
||||
set WDIR=%EXEC_DIR%
|
||||
:findBaseDir
|
||||
IF EXIST "%WDIR%"\.mvn goto baseDirFound
|
||||
cd ..
|
||||
IF "%WDIR%"=="%CD%" goto baseDirNotFound
|
||||
set WDIR=%CD%
|
||||
goto findBaseDir
|
||||
|
||||
:baseDirFound
|
||||
set MAVEN_PROJECTBASEDIR=%WDIR%
|
||||
cd "%EXEC_DIR%"
|
||||
goto endDetectBaseDir
|
||||
|
||||
:baseDirNotFound
|
||||
set MAVEN_PROJECTBASEDIR=%EXEC_DIR%
|
||||
cd "%EXEC_DIR%"
|
||||
|
||||
:endDetectBaseDir
|
||||
|
||||
IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig
|
||||
|
||||
@setlocal EnableExtensions EnableDelayedExpansion
|
||||
for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a
|
||||
@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS%
|
||||
|
||||
:endReadAdditionalConfig
|
||||
|
||||
SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe"
|
||||
set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar"
|
||||
set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
|
||||
|
||||
set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar"
|
||||
|
||||
FOR /F "usebackq tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO (
|
||||
IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B
|
||||
)
|
||||
|
||||
@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
|
||||
@REM This allows using the maven wrapper in projects that prohibit checking in binary data.
|
||||
if exist %WRAPPER_JAR% (
|
||||
if "%MVNW_VERBOSE%" == "true" (
|
||||
echo Found %WRAPPER_JAR%
|
||||
)
|
||||
) else (
|
||||
if not "%MVNW_REPOURL%" == "" (
|
||||
SET DOWNLOAD_URL="%MVNW_REPOURL%/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar"
|
||||
)
|
||||
if "%MVNW_VERBOSE%" == "true" (
|
||||
echo Couldn't find %WRAPPER_JAR%, downloading it ...
|
||||
echo Downloading from: %DOWNLOAD_URL%
|
||||
)
|
||||
|
||||
powershell -Command "&{"^
|
||||
"$webclient = new-object System.Net.WebClient;"^
|
||||
"if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^
|
||||
"$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^
|
||||
"}"^
|
||||
"[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^
|
||||
"}"
|
||||
if "%MVNW_VERBOSE%" == "true" (
|
||||
echo Finished downloading %WRAPPER_JAR%
|
||||
)
|
||||
)
|
||||
@REM End of extension
|
||||
|
||||
@REM Provide a "standardized" way to retrieve the CLI args that will
|
||||
@REM work with both Windows and non-Windows executions.
|
||||
set MAVEN_CMD_LINE_ARGS=%*
|
||||
|
||||
%MAVEN_JAVA_EXE% ^
|
||||
%JVM_CONFIG_MAVEN_PROPS% ^
|
||||
%MAVEN_OPTS% ^
|
||||
%MAVEN_DEBUG_OPTS% ^
|
||||
-classpath %WRAPPER_JAR% ^
|
||||
"-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" ^
|
||||
%WRAPPER_LAUNCHER% %MAVEN_CONFIG% %*
|
||||
if ERRORLEVEL 1 goto error
|
||||
goto end
|
||||
|
||||
:error
|
||||
set ERROR_CODE=1
|
||||
|
||||
:end
|
||||
@endlocal & set ERROR_CODE=%ERROR_CODE%
|
||||
|
||||
if not "%MAVEN_SKIP_RC%"=="" goto skipRcPost
|
||||
@REM check for post script, once with legacy .bat ending and once with .cmd ending
|
||||
if exist "%USERPROFILE%\mavenrc_post.bat" call "%USERPROFILE%\mavenrc_post.bat"
|
||||
if exist "%USERPROFILE%\mavenrc_post.cmd" call "%USERPROFILE%\mavenrc_post.cmd"
|
||||
:skipRcPost
|
||||
|
||||
@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on'
|
||||
if "%MAVEN_BATCH_PAUSE%"=="on" pause
|
||||
|
||||
if "%MAVEN_TERMINATE_CMD%"=="on" exit %ERROR_CODE%
|
||||
|
||||
cmd /C exit /B %ERROR_CODE%
|
||||
@@ -1,87 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>com.example</groupId>
|
||||
<artifactId>demo3</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<name>demo3</name>
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<junit.version>5.9.1</junit.version>
|
||||
<maven.compiler.source>20</maven.compiler.source>
|
||||
<maven.compiler.target>20</maven.compiler.target>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.openjfx</groupId>
|
||||
<artifactId>javafx-controls</artifactId>
|
||||
<version>19</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.openjfx</groupId>
|
||||
<artifactId>javafx-fxml</artifactId>
|
||||
<version>19</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>de.jensd</groupId>
|
||||
<artifactId>fontawesomefx-icons525</artifactId>
|
||||
<version>4.2.0-9.1.2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.json</groupId>
|
||||
<artifactId>json</artifactId>
|
||||
<version>20230227</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.junit.jupiter</groupId>
|
||||
<artifactId>junit-jupiter-api</artifactId>
|
||||
<version>${junit.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.junit.jupiter</groupId>
|
||||
<artifactId>junit-jupiter-engine</artifactId>
|
||||
<version>${junit.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.10.1</version>
|
||||
<configuration>
|
||||
<source>19</source>
|
||||
<target>19</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.openjfx</groupId>
|
||||
<artifactId>javafx-maven-plugin</artifactId>
|
||||
<version>0.0.8</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<!-- Default configuration for running with: mvn clean javafx:run -->
|
||||
<id>default-cli</id>
|
||||
<configuration>
|
||||
<mainClass>com.example.demo3/com.example.demo3.Main</mainClass>
|
||||
<launcher>app</launcher>
|
||||
<jlinkZipName>app</jlinkZipName>
|
||||
<jlinkImageName>app</jlinkImageName>
|
||||
<noManPages>true</noManPages>
|
||||
<stripDebug>true</stripDebug>
|
||||
<noHeaderFiles>true</noHeaderFiles>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
@@ -1,43 +0,0 @@
|
||||
package com.example.demo3;
|
||||
|
||||
import com.example.demo3.items.AdminJson;
|
||||
import com.example.demo3.items.database.TableUser;
|
||||
import com.example.demo3.json.JsonFields;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public class AdminDatabaseFetcher extends Thread{
|
||||
private final Integer idUser;
|
||||
private static Boolean isRunning = true;
|
||||
|
||||
private JSONObject command;
|
||||
|
||||
public AdminDatabaseFetcher(Integer idUser){
|
||||
this.idUser = idUser;
|
||||
setFetchCommand();
|
||||
}
|
||||
|
||||
private void setFetchCommand(){
|
||||
AdminJson adminJson = new AdminJson(JsonFields.tableUsers, JsonFields.commandGetUserDatabase);
|
||||
adminJson.addValues(new TableUser(idUser, null, null, null, null, null));
|
||||
command = new JSONObject(adminJson.getJSON().toString());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run(){
|
||||
while(isRunning){
|
||||
try {
|
||||
String userDatabase = Main.getWritingCommandQueue().run(command.toString());
|
||||
Main.setDatabaseJson(userDatabase);
|
||||
sleep(3000);
|
||||
} catch (IOException | InterruptedException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void closeFetcher(){
|
||||
isRunning = false;
|
||||
}
|
||||
}
|
||||
@@ -1,767 +0,0 @@
|
||||
package com.example.demo3;
|
||||
|
||||
import com.example.demo3.items.AdminJson;
|
||||
import com.example.demo3.items.BaseItem;
|
||||
import com.example.demo3.items.database.TableDeposit;
|
||||
import com.example.demo3.items.database.TableProdInDepo;
|
||||
import com.example.demo3.json.JsonFields;
|
||||
import com.example.demo3.models.DepositModel;
|
||||
import com.example.demo3.models.ProdInDepoModel;
|
||||
import javafx.application.Platform;
|
||||
import javafx.collections.FXCollections;
|
||||
import javafx.collections.ObservableList;
|
||||
import javafx.collections.transformation.FilteredList;
|
||||
import javafx.concurrent.Task;
|
||||
import javafx.event.ActionEvent;
|
||||
import javafx.event.EventHandler;
|
||||
import javafx.fxml.FXML;
|
||||
import javafx.fxml.Initializable;
|
||||
import javafx.scene.Node;
|
||||
import javafx.scene.control.Button;
|
||||
import javafx.scene.control.Label;
|
||||
import javafx.scene.control.TextField;
|
||||
import javafx.scene.control.*;
|
||||
import javafx.scene.control.cell.PropertyValueFactory;
|
||||
import javafx.scene.input.MouseEvent;
|
||||
import javafx.scene.layout.VBox;
|
||||
import javafx.util.Pair;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.awt.*;
|
||||
import java.io.IOException;
|
||||
import java.net.URL;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.ResourceBundle;
|
||||
import java.util.function.Predicate;
|
||||
|
||||
import static java.lang.Float.parseFloat;
|
||||
import static java.lang.Integer.parseInt;
|
||||
import static java.lang.Thread.sleep;
|
||||
|
||||
public class AdminDepositsController implements Initializable{
|
||||
|
||||
@FXML
|
||||
private Label nameLabel;
|
||||
|
||||
@FXML
|
||||
private Label quantityLabel;
|
||||
|
||||
@FXML
|
||||
private Label coordXLabel;
|
||||
|
||||
@FXML
|
||||
private Label coordYLabel;
|
||||
|
||||
@FXML
|
||||
private TableColumn<ProdInDepoModel, Integer> idProductsCol;
|
||||
|
||||
@FXML
|
||||
private TextField coordX;
|
||||
|
||||
@FXML
|
||||
private TableColumn<DepositModel, Float> coordXDepoCol;
|
||||
|
||||
@FXML
|
||||
private TextField coordY;
|
||||
|
||||
@FXML
|
||||
private TableColumn<DepositModel, Float> coordYDepoCol;
|
||||
|
||||
@FXML
|
||||
private Button deleteBtn;
|
||||
|
||||
@FXML
|
||||
private TableView<DepositModel> depositsTable;
|
||||
|
||||
@FXML
|
||||
private TableColumn<DepositModel, Integer> idDepoCol;
|
||||
|
||||
@FXML
|
||||
private Button insertBtn;
|
||||
|
||||
@FXML
|
||||
private TextField name;
|
||||
|
||||
@FXML
|
||||
private TableColumn<DepositModel, String> nameDepoCol;
|
||||
|
||||
@FXML
|
||||
private TableColumn<ProdInDepoModel, String> nameProductsCol;
|
||||
|
||||
@FXML
|
||||
private TableView<ProdInDepoModel> productsTable;
|
||||
|
||||
@FXML
|
||||
private TextField quantity;
|
||||
|
||||
@FXML
|
||||
private TableColumn<ProdInDepoModel, Integer> quantityAvailableProductsCol;
|
||||
|
||||
@FXML
|
||||
private ProgressIndicator progressIndicator;
|
||||
|
||||
@FXML
|
||||
private VBox rightVBox;
|
||||
|
||||
@FXML
|
||||
private TextField searchBar;
|
||||
|
||||
@FXML
|
||||
private TableColumn<ProdInDepoModel, Checkbox> selectedProductCol;
|
||||
|
||||
@FXML
|
||||
private TableColumn<ProdInDepoModel, Checkbox> selectedDepoCol;
|
||||
|
||||
@FXML
|
||||
private TableColumn<ProdInDepoModel, ComboBox> selectedQualityProductsCol;
|
||||
|
||||
@FXML
|
||||
private Button updateBtn;
|
||||
|
||||
@FXML
|
||||
private Button refreshBtn;
|
||||
|
||||
private boolean foundDeposit = false;
|
||||
private boolean foundProduct = false;
|
||||
private boolean foundItem = false;
|
||||
private String responseFromServer;
|
||||
|
||||
private int idSelectedDepo;
|
||||
|
||||
private int countSelected = 0;
|
||||
|
||||
private List<String> failureResponses = new ArrayList<>();
|
||||
|
||||
private void setInvisibleAll(){
|
||||
name.setVisible(false);
|
||||
nameLabel.setVisible(false);
|
||||
quantity.setVisible(false);
|
||||
quantityLabel.setVisible(false);
|
||||
coordY.setVisible(false);
|
||||
coordYLabel.setVisible(false);
|
||||
coordX.setVisible(false);
|
||||
coordXLabel.setVisible(false);
|
||||
}
|
||||
|
||||
private void setVisibleDepo(){
|
||||
name.setVisible(true);
|
||||
nameLabel.setVisible(true);
|
||||
coordXLabel.setVisible(true);
|
||||
coordYLabel.setVisible(true);
|
||||
coordY.setVisible(true);
|
||||
coordX.setVisible(true);
|
||||
}
|
||||
|
||||
private void setVisibleProduct(){
|
||||
name.setVisible(true);
|
||||
nameLabel.setVisible(true);
|
||||
quantityLabel.setVisible(true);
|
||||
quantity.setVisible(true);
|
||||
}
|
||||
|
||||
private boolean searchFind(DepositModel deposit, String searchText){
|
||||
return (deposit.getName().toLowerCase().contains(searchText.toLowerCase()));
|
||||
}
|
||||
private Predicate<DepositModel> createPredicate(String searchText){
|
||||
return deposit -> {
|
||||
if (searchText == null || searchText.isEmpty()) return true;
|
||||
return searchFind(deposit, searchText);
|
||||
};
|
||||
}
|
||||
private static ObservableList<ProdInDepoModel> productModels = FXCollections.observableArrayList();
|
||||
private static ObservableList<DepositModel> depositModels = FXCollections.observableArrayList();
|
||||
private void setDepositModel(){
|
||||
List<TableDeposit> listOfDeposits = Main.getDatabase().getListOfDeposits();
|
||||
listOfDeposits.forEach(deposit -> {
|
||||
depositModels.add(new DepositModel(
|
||||
deposit.getId_deposit(), deposit.getName(), deposit.getLat_coord(), deposit.getLong_coord()
|
||||
));
|
||||
});
|
||||
}
|
||||
|
||||
private void setProductModel(Integer idDepo){
|
||||
Main.getDatabase().getListProductsInDepo().stream()
|
||||
.filter(e -> Objects.equals(e.getKey(), idDepo))
|
||||
.forEach(set -> {
|
||||
Pair<Integer, Integer> pairProductToQuantity = set.getValue();
|
||||
String name = Main.getDatabase().getMapIdToProduct().get(pairProductToQuantity.getKey());
|
||||
productModels.add(new ProdInDepoModel(
|
||||
pairProductToQuantity.getKey(), name, pairProductToQuantity.getValue()
|
||||
));
|
||||
});
|
||||
}
|
||||
|
||||
private void fillDepositsTable(){
|
||||
depositModels.clear();
|
||||
setDepositModel();
|
||||
idDepoCol.setCellValueFactory(new PropertyValueFactory<>("id"));
|
||||
nameDepoCol.setCellValueFactory(new PropertyValueFactory<>("name"));
|
||||
coordXDepoCol.setCellValueFactory(new PropertyValueFactory<>("coordX"));
|
||||
coordYDepoCol.setCellValueFactory(new PropertyValueFactory<>("coordY"));
|
||||
selectedDepoCol.setCellValueFactory(new PropertyValueFactory<>("select"));
|
||||
depositsTable.setItems(depositModels);
|
||||
}
|
||||
|
||||
private void fillProductsTable(Integer idDepo){
|
||||
productModels.clear();
|
||||
setProductModel(idDepo);
|
||||
idProductsCol.setCellValueFactory(new PropertyValueFactory<>("id"));
|
||||
nameProductsCol.setCellValueFactory(new PropertyValueFactory<>("name"));
|
||||
quantityAvailableProductsCol.setCellValueFactory(new PropertyValueFactory<>("quantity"));
|
||||
selectedProductCol.setCellValueFactory(new PropertyValueFactory<>("select"));
|
||||
productsTable.setItems(productModels);
|
||||
}
|
||||
|
||||
private boolean isDepositSelected(){
|
||||
for(int i = 0; i < depositsTable.getItems().size(); i++){
|
||||
if(depositsTable.getItems().get(i).getSelect().isSelected()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private boolean isProductSelected(){
|
||||
for(int i = 0; i < productsTable.getItems().size(); i++){
|
||||
if(productsTable.getItems().get(i).getSelect().isSelected()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private void clearLabels(){
|
||||
name.clear();
|
||||
quantity.clear();
|
||||
coordY.clear();
|
||||
coordX.clear();
|
||||
}
|
||||
Node lastSelectedTable = null;
|
||||
|
||||
@Override
|
||||
public void initialize(URL url, ResourceBundle resourceBundle) {
|
||||
progressIndicator.setVisible(false);
|
||||
setInvisibleAll();
|
||||
fillDepositsTable();
|
||||
depositsTable.setOnMousePressed(new EventHandler<MouseEvent>() {
|
||||
@Override
|
||||
public void handle(MouseEvent mouseEvent) {
|
||||
if (depositsTable.getSelectionModel().getSelectedItem() == null) {
|
||||
setInvisibleAll();
|
||||
setVisibleDepo();
|
||||
} else {
|
||||
clearLabels();
|
||||
setInvisibleAll();
|
||||
setVisibleDepo();
|
||||
productsTable.getItems().clear();
|
||||
Integer idDepo = depositsTable.getSelectionModel().getSelectedItem().getId();
|
||||
fillProductsTable(idDepo);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
productsTable.setOnMousePressed(new EventHandler<MouseEvent>() {
|
||||
@Override
|
||||
public void handle(MouseEvent mouseEvent) {
|
||||
if(productsTable.getSelectionModel().getSelectedItem() == null) {
|
||||
clearLabels();
|
||||
setInvisibleAll();
|
||||
setVisibleProduct();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
deleteBtn.setOnAction(new EventHandler<ActionEvent>() {
|
||||
@Override
|
||||
public void handle(ActionEvent actionEvent) {
|
||||
Task task = new Task(){
|
||||
@Override
|
||||
protected Void call() throws IOException, InterruptedException {
|
||||
progressIndicator.setVisible(true);
|
||||
int percent=0;
|
||||
|
||||
if(isDepositSelected() && !isProductSelected()){
|
||||
//operatii pe deposit
|
||||
updateProgress(percent,100.0);
|
||||
for(int i = 0; i < depositsTable.getItems().size(); i++){
|
||||
if(depositsTable.getItems().get(i).getSelect().isSelected()){
|
||||
if(percent < 50) {
|
||||
updateProgress(percent + 5, 100.0);
|
||||
}else
|
||||
updateProgress(percent,100.0);
|
||||
Integer idDepo = depositsTable.getItems().get(i).getId();
|
||||
AdminJson deleteJson = new AdminJson(JsonFields.tableDeposits, JsonFields.commandDelete);
|
||||
BaseItem tableDepo = new TableDeposit(idDepo, depositsTable.getItems().get(i).getName(),null,null);
|
||||
deleteJson.addValues(tableDepo);
|
||||
JSONObject response = new JSONObject(Main.getWritingCommandQueue().run(deleteJson.getJSON().toString()));
|
||||
|
||||
if(response.getString(JsonFields.response).equals(JsonFields.responseSuccess)){
|
||||
if(percent < 80) {
|
||||
updateProgress(percent + 10, 100.0);
|
||||
}else
|
||||
updateProgress(percent,100.0);
|
||||
sleep(1000);
|
||||
responseFromServer = response.getString(JsonFields.responseMessage);
|
||||
failureResponses.add(response.getString(JsonFields.responseMessage));
|
||||
}else{
|
||||
System.out.println("failure");
|
||||
failureResponses.add(response.getString(JsonFields.responseMessage));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(failureResponses.isEmpty()) {
|
||||
updateProgress(90, 100.0);
|
||||
Main.fetchDatabase();
|
||||
Main.deserializeDatabase();
|
||||
fillDepositsTable();
|
||||
productsTable.getItems().clear();
|
||||
Platform.runLater(() -> {
|
||||
progressIndicator.setVisible(false);
|
||||
});
|
||||
Main.showPopUp(Alert.AlertType.CONFIRMATION, responseFromServer);
|
||||
updateProgress(100, 100.0);
|
||||
sleep(1000);
|
||||
}else{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for(int i = 0; i < failureResponses.size(); i++){
|
||||
sb.append(failureResponses.get(i) + '\n');
|
||||
}
|
||||
failureResponses.clear();
|
||||
Main.fetchDatabase();
|
||||
Main.deserializeDatabase();
|
||||
fillDepositsTable();
|
||||
productsTable.getItems().clear();
|
||||
updateProgress(100,100.0);
|
||||
Main.showPopUp(Alert.AlertType.CONFIRMATION,sb.toString());
|
||||
Platform.runLater(() ->{
|
||||
progressIndicator.setVisible(false);
|
||||
});
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
else if(isProductSelected()){
|
||||
//operatii pe produse
|
||||
updateProgress(percent,100.0);
|
||||
for(int i = 0; i < depositsTable.getItems().size(); i++){
|
||||
if(depositsTable.getSelectionModel().isSelected(i)) {
|
||||
idSelectedDepo = depositsTable.getItems().get(i).getId();
|
||||
}
|
||||
}
|
||||
for(int i = 0; i < productsTable.getItems().size(); i++){
|
||||
if(productsTable.getItems().get(i).getSelect().isSelected()){
|
||||
if(percent < 50) {
|
||||
updateProgress(percent + 5, 100.0);
|
||||
}else
|
||||
updateProgress(percent,100.0);
|
||||
Integer idProduct = productsTable.getItems().get(i).getId();
|
||||
AdminJson deleteJson = new AdminJson(JsonFields.tableProdInDepo, JsonFields.commandDelete);
|
||||
BaseItem tableProduct = new TableProdInDepo(null,idProduct, idSelectedDepo , productsTable.getItems().get(i).getName(),null);
|
||||
deleteJson.addValues(tableProduct);
|
||||
JSONObject response = new JSONObject(Main.getWritingCommandQueue().run(deleteJson.getJSON().toString()));
|
||||
|
||||
if(response.getString(JsonFields.response).equals(JsonFields.responseSuccess)){
|
||||
if(percent < 80) {
|
||||
updateProgress(percent + 10, 100.0);
|
||||
}else
|
||||
updateProgress(percent,100.0);
|
||||
sleep(1000);
|
||||
responseFromServer = response.getString(JsonFields.responseMessage);
|
||||
failureResponses.add(response.getString(JsonFields.responseMessage));
|
||||
}else{
|
||||
System.out.println("failure");
|
||||
failureResponses.add(response.getString(JsonFields.responseMessage));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(failureResponses.isEmpty()) {
|
||||
updateProgress(90, 100.0);
|
||||
Main.fetchDatabase();
|
||||
Main.deserializeDatabase();
|
||||
fillDepositsTable();
|
||||
productsTable.getItems().clear();
|
||||
Platform.runLater(() -> {
|
||||
progressIndicator.setVisible(false);
|
||||
});
|
||||
Main.showPopUp(Alert.AlertType.CONFIRMATION, responseFromServer);
|
||||
updateProgress(100, 100.0);
|
||||
sleep(1000);
|
||||
}else{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for(int i = 0; i < failureResponses.size(); i++){
|
||||
sb.append(failureResponses.get(i) + '\n');
|
||||
}
|
||||
failureResponses.clear();
|
||||
Main.fetchDatabase();
|
||||
Main.deserializeDatabase();
|
||||
fillDepositsTable();
|
||||
productsTable.getItems().clear();
|
||||
updateProgress(100,100.0);
|
||||
Main.showPopUp(Alert.AlertType.CONFIRMATION,sb.toString());
|
||||
Platform.runLater(() ->{
|
||||
progressIndicator.setVisible(false);
|
||||
});
|
||||
return null;
|
||||
}
|
||||
}
|
||||
else if(!isProductSelected() && !isDepositSelected()){
|
||||
Main.showPopUp(Alert.AlertType.ERROR,"No item selected.");
|
||||
Platform.runLater(() ->{
|
||||
progressIndicator.setVisible(false);
|
||||
});
|
||||
return null;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
};
|
||||
|
||||
Thread taskThread = new Thread(task);
|
||||
taskThread.setDaemon(true);
|
||||
taskThread.start();
|
||||
progressIndicator.progressProperty().bind(task.progressProperty());
|
||||
FilteredList<DepositModel> filteredData = new FilteredList<>(FXCollections.observableList(depositModels));
|
||||
depositsTable.setItems(filteredData);
|
||||
|
||||
searchBar.textProperty().addListener((observable, oldValue, newValue) ->
|
||||
filteredData.setPredicate(createPredicate(newValue))
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
insertBtn.setOnAction(new EventHandler<ActionEvent>() {
|
||||
@Override
|
||||
public void handle(ActionEvent actionEvent) {
|
||||
Task task = new Task(){
|
||||
@Override
|
||||
protected Void call() throws IOException, InterruptedException {
|
||||
progressIndicator.setVisible(true);
|
||||
int percent=0;
|
||||
if(!name.isVisible()){
|
||||
Main.showPopUp(Alert.AlertType.ERROR,"No item selected.");
|
||||
Platform.runLater(() ->{
|
||||
progressIndicator.setVisible(false);
|
||||
});
|
||||
}
|
||||
if(!quantity.isVisible()){
|
||||
//operatii pe deposit
|
||||
if(name.getText().isEmpty() || coordX.getText().isEmpty() || coordY.getText().isEmpty()){
|
||||
Main.showPopUp(Alert.AlertType.ERROR, "Complete all the fields.");
|
||||
}
|
||||
|
||||
updateProgress(percent,100.0);
|
||||
|
||||
Float coordXToSend = parseFloat(coordX.getText());
|
||||
Float coordYToSend = parseFloat(coordY.getText());
|
||||
AdminJson deleteJson = new AdminJson(JsonFields.tableDeposits, JsonFields.commandInsert);
|
||||
BaseItem tableDepo = new TableDeposit(null, name.getText(), coordXToSend, coordYToSend);
|
||||
deleteJson.addValues(tableDepo);
|
||||
JSONObject response = new JSONObject(Main.getWritingCommandQueue().run(deleteJson.getJSON().toString()));
|
||||
if(response.getString(JsonFields.response).equals(JsonFields.responseSuccess)){
|
||||
updateProgress(90, 100.0);
|
||||
Main.fetchDatabase();
|
||||
Main.deserializeDatabase();
|
||||
fillDepositsTable();
|
||||
productsTable.getItems().clear();
|
||||
Platform.runLater(() -> {
|
||||
progressIndicator.setVisible(false);
|
||||
});
|
||||
Main.showPopUp(Alert.AlertType.CONFIRMATION, response.getString(JsonFields.responseMessage));
|
||||
updateProgress(100, 100.0);
|
||||
sleep(1000);
|
||||
}else{
|
||||
System.out.println("failure");
|
||||
Main.fetchDatabase();
|
||||
Main.deserializeDatabase();
|
||||
fillDepositsTable();
|
||||
productsTable.getItems().clear();
|
||||
updateProgress(100,100.0);
|
||||
Main.showPopUp(Alert.AlertType.CONFIRMATION,response.getString(JsonFields.responseMessage));
|
||||
Platform.runLater(() ->{
|
||||
progressIndicator.setVisible(false);
|
||||
});
|
||||
return null;
|
||||
}
|
||||
}
|
||||
else if(quantity.isVisible()){
|
||||
//operatii pe produse
|
||||
if(name.getText().isEmpty() || quantity.getText().isEmpty()){
|
||||
Main.showPopUp(Alert.AlertType.ERROR, "Complete all the fields.");
|
||||
}
|
||||
|
||||
updateProgress(percent,100.0);
|
||||
if(!isDepositSelected()){
|
||||
Main.showPopUp(Alert.AlertType.ERROR,"Select a deposit.");
|
||||
Platform.runLater(() ->{
|
||||
progressIndicator.setVisible(false);
|
||||
});
|
||||
return null;
|
||||
}
|
||||
for(int i = 0; i < depositsTable.getItems().size(); i++){
|
||||
if(depositsTable.getItems().get(i).getSelect().isSelected()) {
|
||||
idSelectedDepo = depositsTable.getItems().get(i).getId();
|
||||
}
|
||||
}
|
||||
AdminJson deleteJson = new AdminJson(JsonFields.tableProdInDepo, JsonFields.commandInsert);
|
||||
BaseItem tableProduct = new TableProdInDepo(null,null, idSelectedDepo , name.getText(),parseInt(quantity.getText()));
|
||||
deleteJson.addValues(tableProduct);
|
||||
JSONObject response = new JSONObject(Main.getWritingCommandQueue().run(deleteJson.getJSON().toString()));
|
||||
|
||||
if(response.getString(JsonFields.response).equals(JsonFields.responseSuccess)){
|
||||
updateProgress(90, 100.0);
|
||||
Main.fetchDatabase();
|
||||
Main.deserializeDatabase();
|
||||
fillDepositsTable();
|
||||
productsTable.getItems().clear();
|
||||
Platform.runLater(() -> {
|
||||
progressIndicator.setVisible(false);
|
||||
});
|
||||
Main.showPopUp(Alert.AlertType.CONFIRMATION, response.getString(JsonFields.responseMessage));
|
||||
updateProgress(100, 100.0);
|
||||
sleep(1000);
|
||||
}else{
|
||||
System.out.println("failure");
|
||||
Main.fetchDatabase();
|
||||
Main.deserializeDatabase();
|
||||
fillDepositsTable();
|
||||
productsTable.getItems().clear();
|
||||
updateProgress(100,100.0);
|
||||
Main.showPopUp(Alert.AlertType.CONFIRMATION,response.getString(JsonFields.responseMessage));
|
||||
Platform.runLater(() ->{
|
||||
progressIndicator.setVisible(false);
|
||||
});
|
||||
return null;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
};
|
||||
|
||||
Thread taskThread = new Thread(task);
|
||||
taskThread.setDaemon(true);
|
||||
taskThread.start();
|
||||
progressIndicator.progressProperty().bind(task.progressProperty());
|
||||
FilteredList<DepositModel> filteredData = new FilteredList<>(FXCollections.observableList(depositModels));
|
||||
depositsTable.setItems(filteredData);
|
||||
|
||||
searchBar.textProperty().addListener((observable, oldValue, newValue) ->
|
||||
filteredData.setPredicate(createPredicate(newValue))
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
updateBtn.setOnAction(new EventHandler<ActionEvent>() {
|
||||
@Override
|
||||
public void handle(ActionEvent actionEvent) {
|
||||
Task task = new Task(){
|
||||
@Override
|
||||
protected Void call() throws IOException, InterruptedException {
|
||||
progressIndicator.setVisible(true);
|
||||
int percent=0;
|
||||
if(!name.isVisible()){
|
||||
Main.showPopUp(Alert.AlertType.ERROR,"No table selected.");
|
||||
Platform.runLater(() ->{
|
||||
progressIndicator.setVisible(false);
|
||||
});
|
||||
return null;
|
||||
}
|
||||
if(!quantity.isVisible()){
|
||||
//operatii pe deposit
|
||||
if(name.getText().isEmpty() || coordX.getText().isEmpty() || coordY.getText().isEmpty()){
|
||||
Main.showPopUp(Alert.AlertType.ERROR, "Complete all the fields.");
|
||||
return null;
|
||||
}
|
||||
if(!isDepositSelected()){
|
||||
Main.showPopUp(Alert.AlertType.ERROR,"Select a deposit.");
|
||||
Platform.runLater(() ->{
|
||||
progressIndicator.setVisible(false);
|
||||
});
|
||||
return null;
|
||||
}
|
||||
updateProgress(percent,100.0);
|
||||
Integer count = 0;
|
||||
for(int i = 0; i < depositsTable.getItems().size(); i++){
|
||||
if(depositsTable.getItems().get(i).getSelect().isSelected()) {
|
||||
count++;
|
||||
idSelectedDepo = depositsTable.getItems().get(i).getId();
|
||||
}
|
||||
}
|
||||
if(count > 1){
|
||||
Main.showPopUp(Alert.AlertType.ERROR,"Select only one deposit.");
|
||||
Platform.runLater(() ->{
|
||||
progressIndicator.setVisible(false);
|
||||
});
|
||||
return null;
|
||||
}
|
||||
Float coordXToSend = parseFloat(coordX.getText());
|
||||
Float coordYToSend = parseFloat(coordY.getText());
|
||||
AdminJson deleteJson = new AdminJson(JsonFields.tableDeposits, JsonFields.commandUpdate);
|
||||
BaseItem tableDepo = new TableDeposit(idSelectedDepo, name.getText(), coordXToSend, coordYToSend);
|
||||
deleteJson.addValues(tableDepo);
|
||||
JSONObject response = new JSONObject(Main.getWritingCommandQueue().run(deleteJson.getJSON().toString()));
|
||||
if(response.getString(JsonFields.response).equals(JsonFields.responseSuccess)){
|
||||
updateProgress(90, 100.0);
|
||||
Main.fetchDatabase();
|
||||
Main.deserializeDatabase();
|
||||
fillDepositsTable();
|
||||
productsTable.getItems().clear();
|
||||
Platform.runLater(() -> {
|
||||
progressIndicator.setVisible(false);
|
||||
});
|
||||
Main.showPopUp(Alert.AlertType.CONFIRMATION, response.getString(JsonFields.responseMessage));
|
||||
updateProgress(100, 100.0);
|
||||
sleep(1000);
|
||||
}else{
|
||||
System.out.println("failure");
|
||||
Main.fetchDatabase();
|
||||
Main.deserializeDatabase();
|
||||
fillDepositsTable();
|
||||
productsTable.getItems().clear();
|
||||
updateProgress(100,100.0);
|
||||
Main.showPopUp(Alert.AlertType.CONFIRMATION,response.getString(JsonFields.responseMessage));
|
||||
Platform.runLater(() ->{
|
||||
progressIndicator.setVisible(false);
|
||||
});
|
||||
return null;
|
||||
}
|
||||
}
|
||||
else if(quantity.isVisible()){
|
||||
//operatii pe produse
|
||||
if(quantity.getText().isEmpty()){
|
||||
Main.showPopUp(Alert.AlertType.ERROR, "Complete only the quantity field.");
|
||||
}
|
||||
|
||||
updateProgress(percent,100.0);
|
||||
if(!isDepositSelected()){
|
||||
Main.showPopUp(Alert.AlertType.ERROR,"Select a deposit.");
|
||||
Platform.runLater(() ->{
|
||||
progressIndicator.setVisible(false);
|
||||
});
|
||||
return null;
|
||||
}
|
||||
if(!isProductSelected()){
|
||||
Main.showPopUp(Alert.AlertType.ERROR,"Select a product");
|
||||
Platform.runLater(() ->{
|
||||
progressIndicator.setVisible(false);
|
||||
});
|
||||
return null;
|
||||
}
|
||||
Integer count = 0;
|
||||
for(int i = 0; i < depositsTable.getItems().size(); i++){
|
||||
if(depositsTable.getItems().get(i).getSelect().isSelected()) {
|
||||
count ++;
|
||||
idSelectedDepo = depositsTable.getItems().get(i).getId();
|
||||
if(depositsTable.getSelectionModel().getSelectedItem().getId() != idSelectedDepo){
|
||||
Main.showPopUp(Alert.AlertType.ERROR,"Select only the corresponding deposit");
|
||||
Platform.runLater(() ->{
|
||||
progressIndicator.setVisible(false);
|
||||
});
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(count<=1){
|
||||
count = 0;
|
||||
}
|
||||
Integer idProduct = null;
|
||||
String nameProd = null;
|
||||
|
||||
for(int i = 0; i < productsTable.getItems().size(); i++){
|
||||
if(productsTable.getItems().get(i).getSelect().isSelected()) {
|
||||
count++;
|
||||
idProduct = productsTable.getItems().get(i).getId();
|
||||
nameProd = productsTable.getItems().get(i).getName();
|
||||
}
|
||||
}
|
||||
if(count > 1){
|
||||
Main.showPopUp(Alert.AlertType.ERROR,"Select only one product");
|
||||
Platform.runLater(() ->{
|
||||
progressIndicator.setVisible(false);
|
||||
});
|
||||
return null;
|
||||
}
|
||||
|
||||
AdminJson deleteJson = new AdminJson(JsonFields.tableProdInDepo, JsonFields.commandUpdate);
|
||||
BaseItem tableProduct = new TableProdInDepo(null, idProduct , idSelectedDepo ,nameProd, parseInt(quantity.getText()));
|
||||
deleteJson.addValues(tableProduct);
|
||||
JSONObject response = new JSONObject(Main.getWritingCommandQueue().run(deleteJson.getJSON().toString()));
|
||||
|
||||
if(response.getString(JsonFields.response).equals(JsonFields.responseSuccess)){
|
||||
updateProgress(90, 100.0);
|
||||
Main.fetchDatabase();
|
||||
Main.deserializeDatabase();
|
||||
fillDepositsTable();
|
||||
productsTable.getItems().clear();
|
||||
Platform.runLater(() -> {
|
||||
progressIndicator.setVisible(false);
|
||||
});
|
||||
Main.showPopUp(Alert.AlertType.CONFIRMATION, response.getString(JsonFields.responseMessage));
|
||||
updateProgress(100, 100.0);
|
||||
sleep(1000);
|
||||
}else{
|
||||
System.out.println("failure");
|
||||
Main.fetchDatabase();
|
||||
Main.deserializeDatabase();
|
||||
fillDepositsTable();
|
||||
productsTable.getItems().clear();
|
||||
updateProgress(100,100.0);
|
||||
Main.showPopUp(Alert.AlertType.CONFIRMATION,response.getString(JsonFields.responseMessage));
|
||||
Platform.runLater(() ->{
|
||||
progressIndicator.setVisible(false);
|
||||
});
|
||||
return null;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
};
|
||||
|
||||
Thread taskThread = new Thread(task);
|
||||
taskThread.setDaemon(true);
|
||||
taskThread.start();
|
||||
progressIndicator.progressProperty().bind(task.progressProperty());
|
||||
FilteredList<DepositModel> filteredData = new FilteredList<>(FXCollections.observableList(depositModels));
|
||||
depositsTable.setItems(filteredData);
|
||||
|
||||
searchBar.textProperty().addListener((observable, oldValue, newValue) ->
|
||||
filteredData.setPredicate(createPredicate(newValue))
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
refreshBtn.setOnAction(new EventHandler<ActionEvent>() {
|
||||
@Override
|
||||
public void handle(ActionEvent actionEvent) {
|
||||
Task taskRefresh = new Task() {
|
||||
@Override
|
||||
protected Object call() throws Exception {
|
||||
progressIndicator.setVisible(true);
|
||||
updateProgress(20, 100.0);
|
||||
Main.fetchDatabase();
|
||||
updateProgress(50, 100.0);
|
||||
sleep(1000);
|
||||
Main.deserializeDatabase();
|
||||
updateProgress(70, 100.0);
|
||||
sleep(500);
|
||||
fillDepositsTable();
|
||||
productsTable.getItems().clear();
|
||||
updateProgress(90, 100.0);
|
||||
productsTable.refresh();
|
||||
sleep(1000);
|
||||
Platform.runLater(() ->{
|
||||
progressIndicator.setVisible(false);
|
||||
});
|
||||
return null;
|
||||
}
|
||||
};
|
||||
Thread taskThreadRefresh = new Thread(taskRefresh);
|
||||
taskThreadRefresh.setDaemon(true);
|
||||
taskThreadRefresh.start();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -1,74 +0,0 @@
|
||||
package com.example.demo3;
|
||||
|
||||
import com.example.demo3.items.AdminJson;
|
||||
import com.example.demo3.items.BaseItem;
|
||||
import com.example.demo3.items.database.TableUser;
|
||||
import com.example.demo3.json.JsonFields;
|
||||
import javafx.event.ActionEvent;
|
||||
import javafx.event.EventHandler;
|
||||
import javafx.fxml.FXML;
|
||||
import javafx.fxml.FXMLLoader;
|
||||
import javafx.fxml.Initializable;
|
||||
import javafx.scene.Node;
|
||||
import javafx.scene.Parent;
|
||||
import javafx.scene.Scene;
|
||||
import javafx.scene.control.Button;
|
||||
import javafx.scene.control.Label;
|
||||
import javafx.scene.control.PasswordField;
|
||||
import javafx.scene.control.TextField;
|
||||
import javafx.stage.Stage;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.URL;
|
||||
import java.util.ResourceBundle;
|
||||
|
||||
public class AdminLoginController implements Initializable{
|
||||
@FXML
|
||||
private TextField email;
|
||||
|
||||
@FXML
|
||||
private Label errorField;
|
||||
|
||||
@FXML
|
||||
private Button loginBtn;
|
||||
|
||||
@FXML
|
||||
private PasswordField password;
|
||||
|
||||
private ServerConnection server;
|
||||
|
||||
public void initialize(URL url, ResourceBundle rb){
|
||||
|
||||
loginBtn.setOnAction(new EventHandler<ActionEvent>() {
|
||||
@Override
|
||||
public void handle(ActionEvent actionEvent) {
|
||||
if(email.getText().isBlank() == true || password.getText().isBlank() == true){
|
||||
errorField.setText("Complete all the fields!");
|
||||
}else {
|
||||
AdminJson registerJson = new AdminJson(JsonFields.tableUsers, JsonFields.commandLogin);
|
||||
BaseItem tableUser = new TableUser(null,null, email.getText(), password.getText(), null, null);
|
||||
registerJson.addValues(tableUser);
|
||||
registerJson.getJSON();
|
||||
//Send to server
|
||||
/*try {
|
||||
server = new Server();
|
||||
server.sendMsg(registerJson.getJSON().toString());
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}*/
|
||||
Parent loginViewParent = null;
|
||||
try {
|
||||
loginViewParent = FXMLLoader.load(getClass().getResource("AdminPage.fxml"));
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
Scene loginViewScene = new Scene(loginViewParent);
|
||||
|
||||
Stage window = (Stage)((Node)actionEvent.getSource()).getScene().getWindow();
|
||||
window.setScene(loginViewScene);
|
||||
window.show();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -1,288 +0,0 @@
|
||||
package com.example.demo3;
|
||||
|
||||
import com.example.demo3.items.AdminJson;
|
||||
import com.example.demo3.items.BaseItem;
|
||||
import com.example.demo3.items.database.TableUser;
|
||||
import com.example.demo3.json.JsonFields;
|
||||
import com.example.demo3.models.OrderModel;
|
||||
import com.example.demo3.models.ProdInOrdersModel;
|
||||
import com.example.demo3.models.UserModel;
|
||||
import javafx.application.Platform;
|
||||
import javafx.collections.FXCollections;
|
||||
import javafx.collections.ObservableList;
|
||||
import javafx.collections.transformation.FilteredList;
|
||||
import javafx.concurrent.Task;
|
||||
import javafx.event.ActionEvent;
|
||||
import javafx.event.EventHandler;
|
||||
import javafx.fxml.FXML;
|
||||
import javafx.fxml.Initializable;
|
||||
import javafx.scene.control.*;
|
||||
import javafx.scene.control.cell.PropertyValueFactory;
|
||||
import javafx.scene.input.MouseEvent;
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.net.URL;
|
||||
import java.util.*;
|
||||
import java.util.function.Predicate;
|
||||
|
||||
import static java.lang.Thread.sleep;
|
||||
|
||||
public class AdminOrdersController implements Initializable {
|
||||
@FXML
|
||||
private Button deleteBtn;
|
||||
|
||||
@FXML
|
||||
private TableColumn<OrderModel, Integer> idOrdersCol;
|
||||
|
||||
@FXML
|
||||
private TableColumn<ProdInOrdersModel, Integer> idProductCol;
|
||||
|
||||
@FXML
|
||||
private TableColumn<UserModel, Integer> idUserCol;
|
||||
|
||||
@FXML
|
||||
private TableColumn<ProdInOrdersModel, String> nameProductCol;
|
||||
|
||||
@FXML
|
||||
private TableColumn<UserModel, String> nameUserCol;
|
||||
|
||||
@FXML
|
||||
private TableView<OrderModel> ordersTable;
|
||||
|
||||
@FXML
|
||||
private TableView<ProdInOrdersModel> productsTable;
|
||||
|
||||
@FXML
|
||||
private TableColumn<ProdInOrdersModel, Integer> quantityProductCol;
|
||||
|
||||
@FXML
|
||||
private TextField searchBar;
|
||||
|
||||
@FXML
|
||||
private TableView<UserModel> usersTable;
|
||||
|
||||
@FXML
|
||||
private TableColumn<CheckBox, Boolean> selectedUserCol;
|
||||
|
||||
@FXML
|
||||
private ProgressIndicator progressIndicator;
|
||||
|
||||
@FXML
|
||||
private Button refreshBtn;
|
||||
|
||||
private boolean foundItem = false;
|
||||
private List<String> failureResponses = new ArrayList<>();
|
||||
private String responseFromServer;
|
||||
private static ObservableList<ProdInOrdersModel> productModels = FXCollections.observableArrayList();
|
||||
private static ObservableList<UserModel> userModels = FXCollections.observableArrayList();
|
||||
private static ObservableList<OrderModel> orderModels = FXCollections.observableArrayList();
|
||||
private boolean searchFind(UserModel user, String searchText){
|
||||
return (user.getName().toLowerCase().contains(searchText.toLowerCase()));
|
||||
}
|
||||
private Predicate<UserModel> createPredicate(String searchText){
|
||||
return user -> {
|
||||
if (searchText == null || searchText.isEmpty()) return true;
|
||||
return searchFind(user, searchText);
|
||||
};
|
||||
}
|
||||
private void setProductModels(Integer idOrder) {
|
||||
productModels.clear();
|
||||
Map<Integer, JSONArray> mapOrderToContent = Main.getDatabase().getMapOrderToContent();
|
||||
mapOrderToContent.entrySet().stream()
|
||||
.filter(e -> e.getKey() == idOrder)
|
||||
.forEach(order -> {
|
||||
JSONArray orderJson = order.getValue();
|
||||
|
||||
for(int index = 0; index < orderJson.length(); index++){
|
||||
JSONObject item = orderJson.getJSONObject(index);
|
||||
productModels.add(new ProdInOrdersModel(
|
||||
item.getInt(JsonFields.id_product), item.getString(JsonFields.name),
|
||||
item.getInt(JsonFields.quantity)
|
||||
));
|
||||
}
|
||||
});
|
||||
}
|
||||
private void fillProductTable(){
|
||||
idProductCol.setCellValueFactory(new PropertyValueFactory<>("id"));
|
||||
nameProductCol.setCellValueFactory(new PropertyValueFactory<>("name"));
|
||||
quantityProductCol.setCellValueFactory(new PropertyValueFactory<>("quantity"));
|
||||
productsTable.setItems(productModels);
|
||||
}
|
||||
private void setUsersModels(){
|
||||
userModels.clear();
|
||||
List<TableUser> listOfUsers = Main.getDatabase().getListOfUsers();
|
||||
listOfUsers.stream().filter(e -> !e.getName().equals("Admin")).forEach(user ->{
|
||||
userModels.add(new UserModel(user.getId_user(), user.getName()));
|
||||
});
|
||||
}
|
||||
private void fillUsersTable(){
|
||||
userModels.clear();
|
||||
setUsersModels();
|
||||
idUserCol.setCellValueFactory(new PropertyValueFactory<>("id"));
|
||||
nameUserCol.setCellValueFactory(new PropertyValueFactory<>("name"));
|
||||
selectedUserCol.setCellValueFactory(new PropertyValueFactory<>("select"));
|
||||
usersTable.setItems(userModels);
|
||||
}
|
||||
private void setOrderModels(Integer idUser){
|
||||
orderModels.clear();
|
||||
Map<Integer, Integer> mapUserToOrder = Main.getDatabase().getMapOrderToUser();
|
||||
mapUserToOrder.entrySet().stream()
|
||||
.filter(e -> Objects.equals(e.getValue(), idUser))
|
||||
.forEach(order -> orderModels.add(new OrderModel(order.getKey()))
|
||||
);
|
||||
}
|
||||
private void fillOrdersTable(){
|
||||
idOrdersCol.setCellValueFactory(new PropertyValueFactory<>("id"));
|
||||
ordersTable.setItems(orderModels);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initialize(URL url, ResourceBundle resourceBundle) {
|
||||
progressIndicator.setVisible(false);
|
||||
fillUsersTable();
|
||||
|
||||
usersTable.setOnMousePressed(new EventHandler<MouseEvent>() {
|
||||
@Override
|
||||
public void handle(MouseEvent mouseEvent) {
|
||||
productsTable.getItems().clear();
|
||||
Integer idUser = usersTable.getSelectionModel().getSelectedItem().getId();
|
||||
setOrderModels(idUser);
|
||||
fillOrdersTable();
|
||||
}
|
||||
});
|
||||
|
||||
ordersTable.setOnMousePressed(new EventHandler<MouseEvent>() {
|
||||
@Override
|
||||
public void handle(MouseEvent mouseEvent) {
|
||||
Integer idOrder = ordersTable.getSelectionModel().getSelectedItem().getId();
|
||||
setProductModels(idOrder);
|
||||
fillProductTable();
|
||||
}
|
||||
});
|
||||
//TODO delete si refresh button
|
||||
|
||||
deleteBtn.setOnAction(new EventHandler<ActionEvent>() {
|
||||
@Override
|
||||
public void handle(ActionEvent actionEvent) {
|
||||
Task taskDelete = new Task(){
|
||||
@Override
|
||||
protected Object call() throws Exception {
|
||||
progressIndicator.setVisible(true);
|
||||
int percent=0;
|
||||
for(int i = 0; i < usersTable.getItems().size(); i++){
|
||||
if(usersTable.getItems().get(i).getSelect().isSelected()) {
|
||||
if(percent < 50) {
|
||||
updateProgress(percent + 5, 100.0);
|
||||
}else
|
||||
updateProgress(percent,100.0);
|
||||
foundItem = true;
|
||||
Integer idUser = usersTable.getItems().get(i).getId();
|
||||
AdminJson deleteJson = new AdminJson(JsonFields.tableUsers, JsonFields.commandDelete);
|
||||
BaseItem tableUser = new TableUser(idUser, usersTable.getItems().get(i).getName(),null,null,null,null);
|
||||
deleteJson.addValues(tableUser);
|
||||
JSONObject response = new JSONObject(Main.getWritingCommandQueue().run(deleteJson.getJSON().toString()));
|
||||
updateProgress(70,100.0);
|
||||
|
||||
if(response.getString(JsonFields.response).equals(JsonFields.responseSuccess)){
|
||||
if(percent < 80) {
|
||||
updateProgress(percent + 10, 100.0);
|
||||
}else
|
||||
updateProgress(percent,100.0);
|
||||
sleep(1000);
|
||||
responseFromServer = response.getString(JsonFields.responseMessage);
|
||||
failureResponses.add(response.getString(JsonFields.responseMessage));
|
||||
}else{
|
||||
System.out.println("failure");
|
||||
failureResponses.add(response.getString(JsonFields.responseMessage));
|
||||
}
|
||||
}
|
||||
}
|
||||
if(foundItem == false){
|
||||
Main.showPopUp(Alert.AlertType.ERROR,"No item selected.");
|
||||
Platform.runLater(() ->{
|
||||
progressIndicator.setVisible(false);
|
||||
});
|
||||
return null;
|
||||
}
|
||||
|
||||
if(failureResponses.isEmpty()) {
|
||||
updateProgress(90, 100.0);
|
||||
Main.fetchDatabase();
|
||||
Main.deserializeDatabase();
|
||||
fillUsersTable();
|
||||
ordersTable.getItems().clear();
|
||||
ordersTable.refresh();
|
||||
productsTable.getItems().clear();
|
||||
productsTable.refresh();
|
||||
Platform.runLater(() -> {
|
||||
progressIndicator.setVisible(false);
|
||||
});
|
||||
Main.showPopUp(Alert.AlertType.CONFIRMATION, responseFromServer);
|
||||
updateProgress(100, 100.0);
|
||||
sleep(1000);
|
||||
}else{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for(int i = 0; i < failureResponses.size(); i++){
|
||||
sb.append(failureResponses.get(i) + '\n');
|
||||
}
|
||||
failureResponses.clear();
|
||||
Main.fetchDatabase();
|
||||
Main.deserializeDatabase();
|
||||
fillUsersTable();
|
||||
updateProgress(100,100.0);
|
||||
Main.showPopUp(Alert.AlertType.CONFIRMATION,sb.toString());
|
||||
Platform.runLater(() ->{
|
||||
progressIndicator.setVisible(false);
|
||||
});
|
||||
return null;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
};
|
||||
Thread taskThread = new Thread(taskDelete);
|
||||
taskThread.setDaemon(true);
|
||||
taskThread.start();
|
||||
progressIndicator.progressProperty().bind(taskDelete.progressProperty());
|
||||
FilteredList<UserModel> filteredData = new FilteredList<>(FXCollections.observableList(userModels));
|
||||
usersTable.setItems(filteredData);
|
||||
|
||||
searchBar.textProperty().addListener((observable, oldValue, newValue) ->
|
||||
filteredData.setPredicate(createPredicate(newValue))
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
refreshBtn.setOnAction(new EventHandler<ActionEvent>() {
|
||||
@Override
|
||||
public void handle(ActionEvent actionEvent) {
|
||||
Task taskRefresh = new Task() {
|
||||
@Override
|
||||
protected Object call() throws Exception {
|
||||
progressIndicator.setVisible(true);
|
||||
updateProgress(20, 100.0);
|
||||
Main.fetchDatabase();
|
||||
updateProgress(50, 100.0);
|
||||
sleep(1000);
|
||||
Main.deserializeDatabase();
|
||||
updateProgress(70, 100.0);
|
||||
sleep(500);
|
||||
fillUsersTable();
|
||||
ordersTable.getItems().clear();
|
||||
productsTable.getItems().clear();
|
||||
updateProgress(90, 100.0);
|
||||
updateProgress(100, 100.0);
|
||||
sleep(1000);
|
||||
Platform.runLater(() ->{
|
||||
progressIndicator.setVisible(false);
|
||||
});
|
||||
return null;
|
||||
}
|
||||
};
|
||||
Thread taskThreadRefresh = new Thread(taskRefresh);
|
||||
taskThreadRefresh.setDaemon(true);
|
||||
taskThreadRefresh.start();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -1,107 +0,0 @@
|
||||
package com.example.demo3;
|
||||
|
||||
import javafx.event.ActionEvent;
|
||||
import javafx.event.EventHandler;
|
||||
import javafx.fxml.FXML;
|
||||
import javafx.fxml.Initializable;
|
||||
import javafx.scene.control.Button;
|
||||
import javafx.scene.layout.Pane;
|
||||
import javafx.scene.layout.VBox;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.URL;
|
||||
import java.util.ResourceBundle;
|
||||
|
||||
public class AdminPageController implements Initializable {
|
||||
@FXML
|
||||
private Button depositsBtn;
|
||||
|
||||
@FXML
|
||||
private Button ordersBtn;
|
||||
|
||||
@FXML
|
||||
private Button productsBtn;
|
||||
|
||||
@FXML
|
||||
private VBox rightVBox;
|
||||
|
||||
@FXML
|
||||
private Button routesBtn;
|
||||
|
||||
@FXML
|
||||
private Button logoutBtn;
|
||||
|
||||
public void initialize(URL url, ResourceBundle resourceBundle) {
|
||||
rightVBox.getChildren().clear();
|
||||
FxmlLoader object = new FxmlLoader();
|
||||
try {
|
||||
Pane view = object.GetStage("AdminProducts.fxml");
|
||||
rightVBox.getChildren().setAll(view);
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
productsBtn.setOnAction(new EventHandler<ActionEvent>() {
|
||||
@Override
|
||||
public void handle(ActionEvent actionEvent) {
|
||||
FxmlLoader object = new FxmlLoader();
|
||||
try {
|
||||
Pane view = object.GetStage("AdminProducts.fxml");
|
||||
rightVBox.getChildren().setAll(view);
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
depositsBtn.setOnAction(new EventHandler<ActionEvent>() {
|
||||
@Override
|
||||
public void handle(ActionEvent actionEvent) {
|
||||
FxmlLoader object = new FxmlLoader();
|
||||
try {
|
||||
Pane view = object.GetStage("AdminDeposits.fxml");
|
||||
rightVBox.getChildren().setAll(view);
|
||||
rightVBox.requestLayout();
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
ordersBtn.setOnAction(new EventHandler<ActionEvent>() {
|
||||
@Override
|
||||
public void handle(ActionEvent actionEvent) {
|
||||
FxmlLoader object = new FxmlLoader();
|
||||
try {
|
||||
Pane view = object.GetStage("AdminOrders.fxml");
|
||||
rightVBox.getChildren().setAll(view);
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
routesBtn.setOnAction(new EventHandler<ActionEvent>() {
|
||||
@Override
|
||||
public void handle(ActionEvent actionEvent) {
|
||||
FxmlLoader object = new FxmlLoader();
|
||||
try {
|
||||
Pane view = object.GetStage("AdminRoutes.fxml");
|
||||
rightVBox.getChildren().setAll(view);
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
logoutBtn.setOnAction(new EventHandler<ActionEvent>() {
|
||||
@Override
|
||||
public void handle(ActionEvent actionEvent) {
|
||||
try {
|
||||
Main.loadView(StagesPaths.getView(StagesPaths.LoginPageKey));
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -1,398 +0,0 @@
|
||||
package com.example.demo3;
|
||||
|
||||
import com.example.demo3.items.AdminJson;
|
||||
import com.example.demo3.items.BaseItem;
|
||||
import com.example.demo3.items.database.TableProduct;
|
||||
import com.example.demo3.json.JsonFields;
|
||||
import com.example.demo3.models.ProductModel;
|
||||
import javafx.application.Platform;
|
||||
import javafx.collections.FXCollections;
|
||||
import javafx.collections.ObservableList;
|
||||
import javafx.collections.transformation.FilteredList;
|
||||
import javafx.concurrent.Task;
|
||||
import javafx.event.ActionEvent;
|
||||
import javafx.event.EventHandler;
|
||||
import javafx.fxml.FXML;
|
||||
import javafx.fxml.Initializable;
|
||||
import javafx.scene.control.*;
|
||||
import javafx.scene.control.cell.PropertyValueFactory;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.URL;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.ResourceBundle;
|
||||
import java.util.function.Predicate;
|
||||
|
||||
import static java.lang.Thread.sleep;
|
||||
|
||||
public class AdminProductsController implements Initializable {
|
||||
|
||||
@FXML
|
||||
private TableColumn<ProductModel, Integer> idCol;
|
||||
|
||||
@FXML
|
||||
private TableColumn<ProductModel, String> nameCol;
|
||||
|
||||
@FXML
|
||||
private Button insertBtn;
|
||||
|
||||
@FXML
|
||||
private Button updateBtn;
|
||||
|
||||
@FXML
|
||||
private Button deleteBtn;
|
||||
|
||||
@FXML
|
||||
private TextField name;
|
||||
|
||||
@FXML
|
||||
private TableView<ProductModel> productsTable;
|
||||
|
||||
@FXML
|
||||
private TextField searchBar;
|
||||
|
||||
@FXML
|
||||
private TableColumn<CheckBox, Boolean> selectedCol;
|
||||
|
||||
@FXML
|
||||
private Button refreshBtn;
|
||||
|
||||
@FXML
|
||||
private ProgressIndicator progressIndicator;
|
||||
|
||||
private boolean foundItem = false;
|
||||
|
||||
private String responseFromServer;
|
||||
|
||||
private int countSelected = 0;
|
||||
|
||||
private List<String> failureResponses = new ArrayList<>();
|
||||
private static ObservableList<ProductModel> productModels = FXCollections.observableArrayList();
|
||||
|
||||
private boolean searchFind(ProductModel product, String searchText){
|
||||
return (product.getName().toLowerCase().contains(searchText.toLowerCase()));
|
||||
}
|
||||
|
||||
private Predicate<ProductModel> createPredicate(String searchText){
|
||||
return product -> {
|
||||
if (searchText == null || searchText.isEmpty()) return true;
|
||||
return searchFind(product, searchText);
|
||||
};
|
||||
}
|
||||
private void setProductModels(){
|
||||
Map<Integer, String> mapIdToProduct = Main.getDatabase().getMapIdToProduct();
|
||||
for(Map.Entry<Integer, String> entry : mapIdToProduct.entrySet()){
|
||||
productModels.add(new ProductModel(
|
||||
entry.getKey(), entry.getValue()
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
private void fillTable(){
|
||||
productModels.clear();
|
||||
setProductModels();
|
||||
idCol.setCellValueFactory(new PropertyValueFactory<>("id"));
|
||||
nameCol.setCellValueFactory(new PropertyValueFactory<>("name"));
|
||||
selectedCol.setCellValueFactory(new PropertyValueFactory<>("select"));
|
||||
productsTable.setItems(productModels);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public void initialize(URL url, ResourceBundle resourceBundle) {
|
||||
|
||||
progressIndicator.setVisible(false);
|
||||
fillTable();
|
||||
|
||||
deleteBtn.setOnAction(new EventHandler<ActionEvent>() {
|
||||
@Override
|
||||
public void handle(ActionEvent actionEvent) {
|
||||
Task task = new Task(){
|
||||
@Override
|
||||
protected Void call() throws IOException, InterruptedException {
|
||||
progressIndicator.setVisible(true);
|
||||
int percent=0;
|
||||
updateProgress(percent,100.0);
|
||||
for(int i = 0; i < productsTable.getItems().size(); i++){
|
||||
if(productsTable.getItems().get(i).getSelect().isSelected()){
|
||||
if(percent < 50) {
|
||||
updateProgress(percent + 5, 100.0);
|
||||
}else
|
||||
updateProgress(percent,100.0);
|
||||
foundItem = true;
|
||||
Integer idProduct = productsTable.getItems().get(i).getId();
|
||||
AdminJson deleteJson = new AdminJson(JsonFields.tableProducts, JsonFields.commandDelete);
|
||||
BaseItem tableProduct = new TableProduct(idProduct, productsTable.getItems().get(i).getName());
|
||||
deleteJson.addValues(tableProduct);
|
||||
JSONObject response = new JSONObject(Main.getWritingCommandQueue().run(deleteJson.getJSON().toString()));
|
||||
|
||||
if(response.getString(JsonFields.response).equals(JsonFields.responseSuccess)){
|
||||
if(percent < 80) {
|
||||
updateProgress(percent + 10, 100.0);
|
||||
}else
|
||||
updateProgress(percent,100.0);
|
||||
sleep(1000);
|
||||
responseFromServer = response.getString(JsonFields.responseMessage);
|
||||
failureResponses.add(response.getString(JsonFields.responseMessage));
|
||||
}else{
|
||||
System.out.println("failure");
|
||||
failureResponses.add(response.getString(JsonFields.responseMessage));
|
||||
}
|
||||
}
|
||||
}
|
||||
if(foundItem == false){
|
||||
Main.showPopUp(Alert.AlertType.ERROR,"No item selected.");
|
||||
Platform.runLater(() ->{
|
||||
progressIndicator.setVisible(false);
|
||||
});
|
||||
return null;
|
||||
}
|
||||
|
||||
if(failureResponses.isEmpty()) {
|
||||
updateProgress(90, 100.0);
|
||||
Main.fetchDatabase();
|
||||
Main.deserializeDatabase();
|
||||
fillTable();
|
||||
Platform.runLater(() -> {
|
||||
progressIndicator.setVisible(false);
|
||||
});
|
||||
Main.showPopUp(Alert.AlertType.CONFIRMATION, responseFromServer);
|
||||
updateProgress(100, 100.0);
|
||||
sleep(1000);
|
||||
}else{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for(int i = 0; i < failureResponses.size(); i++){
|
||||
sb.append(failureResponses.get(i) + '\n');
|
||||
}
|
||||
failureResponses.clear();
|
||||
Main.fetchDatabase();
|
||||
Main.deserializeDatabase();
|
||||
fillTable();
|
||||
updateProgress(100,100.0);
|
||||
Main.showPopUp(Alert.AlertType.CONFIRMATION,sb.toString());
|
||||
Platform.runLater(() ->{
|
||||
progressIndicator.setVisible(false);
|
||||
});
|
||||
return null;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
};
|
||||
|
||||
Thread taskThread = new Thread(task);
|
||||
taskThread.setDaemon(true);
|
||||
taskThread.start();
|
||||
progressIndicator.progressProperty().bind(task.progressProperty());
|
||||
FilteredList<ProductModel> filteredData = new FilteredList<>(FXCollections.observableList(productModels));
|
||||
productsTable.setItems(filteredData);
|
||||
|
||||
searchBar.textProperty().addListener((observable, oldValue, newValue) ->
|
||||
filteredData.setPredicate(createPredicate(newValue))
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
insertBtn.setOnAction(new EventHandler<ActionEvent>() {
|
||||
@Override
|
||||
public void handle(ActionEvent actionEvent) {
|
||||
Task task = new Task(){
|
||||
@Override
|
||||
protected Void call() throws IOException, InterruptedException {
|
||||
if(name.getText().isBlank()){
|
||||
Main.showPopUp(Alert.AlertType.ERROR, "Set the name for a product.");
|
||||
return null;
|
||||
}
|
||||
progressIndicator.setVisible(true);
|
||||
updateProgress(0,0.0);
|
||||
AdminJson insertJson = new AdminJson(JsonFields.tableProducts, JsonFields.commandInsert);
|
||||
BaseItem product = new TableProduct(null, name.getText());
|
||||
updateProgress(50,100.0);
|
||||
insertJson.addValues(product);
|
||||
JSONObject response = new JSONObject(Main.getWritingCommandQueue().run(insertJson.getJSON().toString()));
|
||||
if(response.getString(JsonFields.response).equals(JsonFields.responseSuccess)){
|
||||
sleep(1000);
|
||||
updateProgress(60,100.0);
|
||||
Main.fetchDatabase();
|
||||
updateProgress(80,100.0);
|
||||
Main.deserializeDatabase();
|
||||
updateProgress(90,100.0);
|
||||
fillTable();
|
||||
updateProgress(100,100.0);
|
||||
Main.showPopUp(Alert.AlertType.CONFIRMATION, response.getString(JsonFields.responseMessage));
|
||||
Platform.runLater(() -> {
|
||||
progressIndicator.setVisible(false);
|
||||
});
|
||||
return null;
|
||||
}else{
|
||||
updateProgress(100,100.0);
|
||||
Main.showPopUp(Alert.AlertType.ERROR, response.getString(JsonFields.responseMessage));
|
||||
Platform.runLater(() -> {
|
||||
progressIndicator.setVisible(false);
|
||||
});
|
||||
}
|
||||
return null;
|
||||
}
|
||||
};
|
||||
|
||||
Thread taskThread = new Thread(task);
|
||||
taskThread.setDaemon(true);
|
||||
taskThread.start();
|
||||
progressIndicator.progressProperty().bind(task.progressProperty());
|
||||
FilteredList<ProductModel> filteredData = new FilteredList<>(FXCollections.observableList(productModels));
|
||||
productsTable.setItems(filteredData);
|
||||
|
||||
searchBar.textProperty().addListener((observable, oldValue, newValue) ->
|
||||
filteredData.setPredicate(createPredicate(newValue))
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
updateBtn.setOnAction(new EventHandler<ActionEvent>() {
|
||||
@Override
|
||||
public void handle(ActionEvent actionEvent) {
|
||||
Task task = new Task(){
|
||||
@Override
|
||||
protected Void call() throws IOException, InterruptedException {
|
||||
countSelected = 0;
|
||||
failureResponses.clear();
|
||||
progressIndicator.setVisible(true);
|
||||
int percent=0;
|
||||
updateProgress(percent,100.0);
|
||||
for(int i = 0; i < productsTable.getItems().size(); i++){
|
||||
if(productsTable.getItems().get(i).getSelect().isSelected()) {
|
||||
countSelected++;
|
||||
}
|
||||
}
|
||||
if(countSelected > 1){
|
||||
Main.showPopUp(Alert.AlertType.ERROR,"You can't update multiple items at once.");
|
||||
Platform.runLater(() ->{
|
||||
progressIndicator.setVisible(false);
|
||||
});
|
||||
return null;
|
||||
}
|
||||
for(int i = 0; i < productsTable.getItems().size(); i++){
|
||||
if(productsTable.getItems().get(i).getSelect().isSelected()){
|
||||
if(percent < 50) {
|
||||
updateProgress(percent + 5, 100.0);
|
||||
}else
|
||||
updateProgress(percent,100.0);
|
||||
foundItem = true;
|
||||
Integer idProduct = productsTable.getItems().get(i).getId();
|
||||
String newName = name.getText();
|
||||
if(newName.isEmpty()){
|
||||
Main.showPopUp(Alert.AlertType.ERROR,"Enter a name.");
|
||||
Platform.runLater(() ->{
|
||||
progressIndicator.setVisible(false);
|
||||
});
|
||||
return null;
|
||||
}
|
||||
AdminJson updateJson = new AdminJson(JsonFields.tableProducts, JsonFields.commandUpdate);
|
||||
BaseItem product = new TableProduct(idProduct, newName);
|
||||
updateJson.addValues(product);
|
||||
JSONObject response = new JSONObject(Main.getWritingCommandQueue().run(updateJson.getJSON().toString()));
|
||||
|
||||
if(response.getString(JsonFields.response).equals(JsonFields.responseSuccess)){
|
||||
updateProgress(60, 100.0);
|
||||
Main.fetchDatabase();
|
||||
updateProgress(80, 100.0);
|
||||
Main.deserializeDatabase();
|
||||
updateProgress(90, 100.0);
|
||||
fillTable();
|
||||
Platform.runLater(() -> {
|
||||
progressIndicator.setVisible(false);
|
||||
});
|
||||
Main.showPopUp(Alert.AlertType.CONFIRMATION, responseFromServer);
|
||||
updateProgress(100, 100.0);
|
||||
sleep(1000);
|
||||
return null;
|
||||
}else{
|
||||
updateProgress(70, 100.0);
|
||||
Main.fetchDatabase();
|
||||
updateProgress(80, 100.0);
|
||||
Main.deserializeDatabase();
|
||||
updateProgress(90, 100.0);
|
||||
fillTable();
|
||||
updateProgress(100,100.0);
|
||||
Main.showPopUp(Alert.AlertType.ERROR,response.getString(JsonFields.responseMessage));
|
||||
Platform.runLater(() ->{
|
||||
progressIndicator.setVisible(false);
|
||||
});
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(foundItem == false){
|
||||
Main.showPopUp(Alert.AlertType.ERROR,"No item selected.");
|
||||
Platform.runLater(() ->{
|
||||
progressIndicator.setVisible(false);
|
||||
});
|
||||
return null;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
};
|
||||
|
||||
Thread taskThread = new Thread(task);
|
||||
taskThread.setDaemon(true);
|
||||
taskThread.start();
|
||||
progressIndicator.progressProperty().bind(task.progressProperty());
|
||||
FilteredList<ProductModel> filteredData = new FilteredList<>(FXCollections.observableList(productModels));
|
||||
productsTable.setItems(filteredData);
|
||||
|
||||
searchBar.textProperty().addListener((observable, oldValue, newValue) ->
|
||||
filteredData.setPredicate(createPredicate(newValue))
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
refreshBtn.setOnAction(new EventHandler<ActionEvent>() {
|
||||
@Override
|
||||
public void handle(ActionEvent actionEvent) {
|
||||
Task taskRefresh = new Task() {
|
||||
@Override
|
||||
protected Object call() throws Exception {
|
||||
progressIndicator.setVisible(true);
|
||||
updateProgress(20, 100.0);
|
||||
Main.fetchDatabase();
|
||||
updateProgress(50, 100.0);
|
||||
sleep(1000);
|
||||
Main.deserializeDatabase();
|
||||
updateProgress(70, 100.0);
|
||||
sleep(500);
|
||||
fillTable();
|
||||
updateProgress(90, 100.0);
|
||||
productsTable.refresh();
|
||||
updateProgress(100, 100.0);
|
||||
sleep(1000);
|
||||
Platform.runLater(() ->{
|
||||
progressIndicator.setVisible(false);
|
||||
});
|
||||
return null;
|
||||
}
|
||||
};
|
||||
Thread taskThreadRefresh = new Thread(taskRefresh);
|
||||
taskThreadRefresh.setDaemon(true);
|
||||
taskThreadRefresh.start();
|
||||
progressIndicator.progressProperty().bind(taskRefresh.progressProperty());
|
||||
FilteredList<ProductModel> filteredData = new FilteredList<>(FXCollections.observableList(productModels));
|
||||
productsTable.setItems(filteredData);
|
||||
|
||||
searchBar.textProperty().addListener((observable, oldValue, newValue) ->
|
||||
filteredData.setPredicate(createPredicate(newValue))
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
FilteredList<ProductModel> filteredData = new FilteredList<>(FXCollections.observableList(productModels));
|
||||
productsTable.setItems(filteredData);
|
||||
|
||||
searchBar.textProperty().addListener((observable, oldValue, newValue) ->
|
||||
filteredData.setPredicate(createPredicate(newValue))
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
Manifest-Version: 1.0
|
||||
Main-Class: com.example.demo3.Main
|
||||
|
||||
Binary file not shown.
@@ -1,148 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<?import javafx.geometry.Insets?>
|
||||
<?import javafx.scene.control.Button?>
|
||||
<?import javafx.scene.control.Label?>
|
||||
<?import javafx.scene.control.ProgressIndicator?>
|
||||
<?import javafx.scene.control.TableColumn?>
|
||||
<?import javafx.scene.control.TableView?>
|
||||
<?import javafx.scene.control.TextField?>
|
||||
<?import javafx.scene.layout.HBox?>
|
||||
<?import javafx.scene.layout.VBox?>
|
||||
<?import javafx.scene.text.Font?>
|
||||
|
||||
<VBox fx:id="rightVBox" alignment="TOP_CENTER" prefHeight="600.0" prefWidth="864.0" stylesheets="@Login.css" xmlns="http://javafx.com/javafx/20.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.example.demo3.AdminDepositsController">
|
||||
<children>
|
||||
<HBox alignment="CENTER" spacing="10.0">
|
||||
<VBox.margin>
|
||||
<Insets bottom="10.0" top="15.0" />
|
||||
</VBox.margin>
|
||||
<children>
|
||||
<TextField fx:id="searchBar" maxWidth="300.0" minWidth="100.0" prefWidth="300.0" promptText="search..." styleClass="label-form" />
|
||||
<Button fx:id="refreshBtn" mnemonicParsing="false" text="refresh" />
|
||||
<ProgressIndicator fx:id="progressIndicator" progress="0.0" />
|
||||
</children>
|
||||
</HBox>
|
||||
<HBox alignment="CENTER" prefHeight="437.0" prefWidth="799.0" VBox.vgrow="ALWAYS">
|
||||
<children>
|
||||
<VBox alignment="CENTER" stylesheets="@Login.css" HBox.hgrow="ALWAYS">
|
||||
<children>
|
||||
<Label text="DEPOSITS">
|
||||
<VBox.margin>
|
||||
<Insets bottom="10.0" top="10.0" />
|
||||
</VBox.margin>
|
||||
<font>
|
||||
<Font size="14.0" />
|
||||
</font>
|
||||
</Label>
|
||||
<TableView fx:id="depositsTable" editable="true" prefHeight="395.0" prefWidth="0.0" stylesheets="@Login.css" VBox.vgrow="ALWAYS">
|
||||
<columns>
|
||||
<TableColumn fx:id="idDepoCol" prefWidth="83.0" text="id" />
|
||||
<TableColumn fx:id="nameDepoCol" prefWidth="91.0" text="name" />
|
||||
<TableColumn fx:id="coordXDepoCol" prefWidth="91.0" text="coord X" />
|
||||
<TableColumn fx:id="coordYDepoCol" prefWidth="91.0" text="coord Y" />
|
||||
<TableColumn fx:id="selectedDepoCol" prefWidth="91.0" text="selected" />
|
||||
</columns>
|
||||
<columnResizePolicy>
|
||||
<TableView fx:constant="CONSTRAINED_RESIZE_POLICY" />
|
||||
</columnResizePolicy>
|
||||
</TableView>
|
||||
</children>
|
||||
</VBox>
|
||||
<VBox alignment="CENTER" prefHeight="200.0" prefWidth="100.0" stylesheets="@Login.css" HBox.hgrow="ALWAYS">
|
||||
<children>
|
||||
<Label text="PRODUCTS">
|
||||
<font>
|
||||
<Font size="14.0" />
|
||||
</font>
|
||||
<VBox.margin>
|
||||
<Insets bottom="10.0" top="10.0" />
|
||||
</VBox.margin>
|
||||
</Label>
|
||||
<TableView fx:id="productsTable" editable="true" prefHeight="446.0" prefWidth="638.0" stylesheets="@Login.css" VBox.vgrow="ALWAYS">
|
||||
<columns>
|
||||
<TableColumn fx:id="idProductsCol" prefWidth="28.0" text="id" />
|
||||
<TableColumn fx:id="nameProductsCol" prefWidth="69.0" text="name" />
|
||||
<TableColumn fx:id="quantityAvailableProductsCol" prefWidth="125.0" text="quantity available" />
|
||||
<TableColumn fx:id="selectedProductCol" prefWidth="111.0" text="selected" />
|
||||
</columns>
|
||||
<columnResizePolicy>
|
||||
<TableView fx:constant="CONSTRAINED_RESIZE_POLICY" />
|
||||
</columnResizePolicy>
|
||||
</TableView>
|
||||
</children>
|
||||
</VBox>
|
||||
</children>
|
||||
</HBox>
|
||||
<HBox alignment="CENTER" prefHeight="100.0" prefWidth="200.0">
|
||||
<children>
|
||||
<VBox alignment="CENTER_LEFT" prefHeight="100.0" prefWidth="63.0">
|
||||
<children>
|
||||
<Label fx:id="nameLabel" text="Name">
|
||||
<VBox.margin>
|
||||
<Insets bottom="10.0" left="10.0" />
|
||||
</VBox.margin>
|
||||
</Label>
|
||||
<Label fx:id="quantityLabel" text="Quantity">
|
||||
<VBox.margin>
|
||||
<Insets left="10.0" />
|
||||
</VBox.margin>
|
||||
</Label>
|
||||
</children>
|
||||
</VBox>
|
||||
<VBox alignment="CENTER_LEFT" prefHeight="200.0" prefWidth="100.0">
|
||||
<children>
|
||||
<TextField fx:id="name">
|
||||
<VBox.margin>
|
||||
<Insets bottom="10.0" />
|
||||
</VBox.margin>
|
||||
</TextField>
|
||||
<TextField fx:id="quantity" />
|
||||
</children>
|
||||
<HBox.margin>
|
||||
<Insets right="10.0" />
|
||||
</HBox.margin>
|
||||
</VBox>
|
||||
<VBox alignment="CENTER_LEFT" prefHeight="100.0" prefWidth="63.0">
|
||||
<children>
|
||||
<Label fx:id="coordXLabel" text="Coord X">
|
||||
<VBox.margin>
|
||||
<Insets bottom="10.0" left="10.0" />
|
||||
</VBox.margin>
|
||||
</Label>
|
||||
<Label fx:id="coordYLabel" text="Coord Y">
|
||||
<VBox.margin>
|
||||
<Insets left="10.0" />
|
||||
</VBox.margin>
|
||||
</Label>
|
||||
</children>
|
||||
</VBox>
|
||||
<VBox alignment="CENTER_LEFT" prefHeight="200.0" prefWidth="100.0">
|
||||
<children>
|
||||
<TextField fx:id="coordX">
|
||||
<VBox.margin>
|
||||
<Insets bottom="10.0" />
|
||||
</VBox.margin>
|
||||
</TextField>
|
||||
<TextField fx:id="coordY" />
|
||||
</children>
|
||||
</VBox>
|
||||
<Button fx:id="insertBtn" mnemonicParsing="false" prefHeight="31.0" prefWidth="100.0" text="INSERT">
|
||||
<HBox.margin>
|
||||
<Insets left="50.0" />
|
||||
</HBox.margin>
|
||||
</Button>
|
||||
<Button fx:id="updateBtn" mnemonicParsing="false" prefHeight="31.0" prefWidth="100.0" text="UPDATE">
|
||||
<HBox.margin>
|
||||
<Insets left="50.0" />
|
||||
</HBox.margin>
|
||||
</Button>
|
||||
<Button fx:id="deleteBtn" mnemonicParsing="false" prefHeight="31.0" prefWidth="100.0" text="DELETE">
|
||||
<HBox.margin>
|
||||
<Insets left="50.0" />
|
||||
</HBox.margin>
|
||||
</Button>
|
||||
</children>
|
||||
</HBox>
|
||||
</children>
|
||||
</VBox>
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,56 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<?import de.jensd.fx.glyphs.icons525.Icons525View?>
|
||||
<?import javafx.geometry.Insets?>
|
||||
<?import javafx.scene.control.Button?>
|
||||
<?import javafx.scene.control.Label?>
|
||||
<?import javafx.scene.control.PasswordField?>
|
||||
<?import javafx.scene.control.TextField?>
|
||||
<?import javafx.scene.layout.HBox?>
|
||||
<?import javafx.scene.layout.VBox?>
|
||||
<?import javafx.scene.text.Font?>
|
||||
|
||||
<HBox alignment="CENTER" prefHeight="600.0" prefWidth="1000.0" stylesheets="@Login.css" xmlns="http://javafx.com/javafx/19" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.example.demo3.AdminLoginController">
|
||||
<children>
|
||||
<VBox alignment="CENTER" prefHeight="600.0" prefWidth="300.0" styleClass="left-form" stylesheets="@Login.css" HBox.hgrow="ALWAYS">
|
||||
<children>
|
||||
<Icons525View glyphName="USER" size="100" text="" />
|
||||
<Label styleClass="label-form" stylesheets="@Login.css" text="Delivery Planner">
|
||||
<font>
|
||||
<Font name="System Bold" size="23.0" />
|
||||
</font>
|
||||
</Label>
|
||||
<Label styleClass="label-form" stylesheets="@Login.css" text="Admin">
|
||||
<font>
|
||||
<Font name="System Bold" size="20.0" />
|
||||
</font>
|
||||
</Label>
|
||||
<Label styleClass="label-form" stylesheets="@Login.css" text="Console">
|
||||
<font>
|
||||
<Font name="System Bold" size="20.0" />
|
||||
</font>
|
||||
</Label>
|
||||
</children>
|
||||
</VBox>
|
||||
<VBox alignment="CENTER" prefHeight="600.0" prefWidth="500.0" spacing="20.0" styleClass="right-form" stylesheets="@Login.css" HBox.hgrow="ALWAYS">
|
||||
<children>
|
||||
<Label styleClass="label-form" stylesheets="@Login.css" text="Welcome Back!">
|
||||
<font>
|
||||
<Font name="System Bold" size="30.0" />
|
||||
</font>
|
||||
</Label>
|
||||
<Label fx:id="errorField" textFill="RED" />
|
||||
<TextField fx:id="email" maxWidth="200.0" prefHeight="34.0" prefWidth="149.0" promptText="email" />
|
||||
<PasswordField fx:id="password" maxWidth="200.0" prefHeight="34.0" prefWidth="149.0" promptText="password" />
|
||||
<Button fx:id="loginBtn" maxWidth="200.0" mnemonicParsing="false" prefHeight="34.0" prefWidth="149.0" styleClass="label-form" text="login">
|
||||
<font>
|
||||
<Font name="System Bold" size="12.0" />
|
||||
</font>
|
||||
</Button>
|
||||
</children>
|
||||
<padding>
|
||||
<Insets left="30.0" right="30.0" />
|
||||
</padding>
|
||||
</VBox>
|
||||
</children>
|
||||
</HBox>
|
||||
Binary file not shown.
Binary file not shown.
@@ -1,107 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<?import javafx.geometry.Insets?>
|
||||
<?import javafx.scene.control.Button?>
|
||||
<?import javafx.scene.control.Label?>
|
||||
<?import javafx.scene.control.ProgressIndicator?>
|
||||
<?import javafx.scene.control.TableColumn?>
|
||||
<?import javafx.scene.control.TableView?>
|
||||
<?import javafx.scene.control.TextField?>
|
||||
<?import javafx.scene.layout.AnchorPane?>
|
||||
<?import javafx.scene.layout.HBox?>
|
||||
<?import javafx.scene.layout.VBox?>
|
||||
|
||||
<AnchorPane xmlns="http://javafx.com/javafx/20.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.example.demo3.AdminOrdersController">
|
||||
<children>
|
||||
<VBox alignment="TOP_CENTER" prefHeight="600.0" prefWidth="864.0" stylesheets="@Login.css" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
|
||||
<children>
|
||||
<HBox alignment="CENTER" spacing="10.0">
|
||||
<VBox.margin>
|
||||
<Insets bottom="15.0" top="15.0" />
|
||||
</VBox.margin>
|
||||
<children>
|
||||
<TextField fx:id="searchBar" maxWidth="300.0" minWidth="100.0" prefWidth="300.0" promptText="search..." styleClass="label-form" />
|
||||
<Button fx:id="refreshBtn" mnemonicParsing="false" text="refresh" />
|
||||
<ProgressIndicator fx:id="progressIndicator" progress="0.0" />
|
||||
</children>
|
||||
</HBox>
|
||||
<AnchorPane prefHeight="440.0" prefWidth="864.0" VBox.vgrow="ALWAYS">
|
||||
<VBox.margin>
|
||||
<Insets />
|
||||
</VBox.margin>
|
||||
<children>
|
||||
<HBox alignment="TOP_CENTER" prefHeight="288.0" prefWidth="864.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
|
||||
<children>
|
||||
<VBox alignment="CENTER" maxWidth="-Infinity" prefHeight="545.0" prefWidth="341.0" HBox.hgrow="ALWAYS">
|
||||
<children>
|
||||
<Label text="USERS">
|
||||
<VBox.margin>
|
||||
<Insets bottom="5.0" />
|
||||
</VBox.margin>
|
||||
</Label>
|
||||
<TableView fx:id="usersTable" editable="true" prefHeight="174.0" prefWidth="775.0" VBox.vgrow="ALWAYS">
|
||||
<columns>
|
||||
<TableColumn fx:id="idUserCol" prefWidth="75.0" text="id" />
|
||||
<TableColumn fx:id="nameUserCol" prefWidth="75.0" text="name" />
|
||||
<TableColumn fx:id="selectedUserCol" prefWidth="75.0" text="select" />
|
||||
</columns>
|
||||
<columnResizePolicy>
|
||||
<TableView fx:constant="CONSTRAINED_RESIZE_POLICY" />
|
||||
</columnResizePolicy>
|
||||
</TableView>
|
||||
<Label text="ORDERS">
|
||||
<VBox.margin>
|
||||
<Insets bottom="5.0" top="5.0" />
|
||||
</VBox.margin>
|
||||
</Label>
|
||||
<TableView fx:id="ordersTable" editable="true" prefHeight="203.0" prefWidth="227.0" stylesheets="@Login.css" VBox.vgrow="ALWAYS">
|
||||
<columns>
|
||||
<TableColumn fx:id="idOrdersCol" minWidth="0.0" prefWidth="102.0" text="order id" />
|
||||
</columns>
|
||||
<columnResizePolicy>
|
||||
<TableView fx:constant="CONSTRAINED_RESIZE_POLICY" />
|
||||
</columnResizePolicy>
|
||||
</TableView>
|
||||
</children>
|
||||
</VBox>
|
||||
<VBox alignment="TOP_CENTER" prefHeight="545.0" prefWidth="752.0" HBox.hgrow="ALWAYS">
|
||||
<children>
|
||||
<Label text="PRODUCTS">
|
||||
<VBox.margin>
|
||||
<Insets bottom="5.0" />
|
||||
</VBox.margin>
|
||||
</Label>
|
||||
<TableView fx:id="productsTable" editable="true" prefHeight="528.0" prefWidth="283.0" VBox.vgrow="ALWAYS">
|
||||
<columns>
|
||||
<TableColumn fx:id="idProductCol" prefWidth="95.0" text="id" />
|
||||
<TableColumn fx:id="nameProductCol" prefWidth="351.0" text="name" />
|
||||
<TableColumn fx:id="quantityProductCol" prefWidth="313.0" text="quantity" />
|
||||
</columns>
|
||||
<columnResizePolicy>
|
||||
<TableView fx:constant="CONSTRAINED_RESIZE_POLICY" />
|
||||
</columnResizePolicy>
|
||||
<opaqueInsets>
|
||||
<Insets />
|
||||
</opaqueInsets>
|
||||
</TableView>
|
||||
</children>
|
||||
</VBox>
|
||||
</children>
|
||||
<opaqueInsets>
|
||||
<Insets />
|
||||
</opaqueInsets>
|
||||
</HBox>
|
||||
</children>
|
||||
</AnchorPane>
|
||||
<HBox alignment="CENTER">
|
||||
<VBox.margin>
|
||||
<Insets bottom="10.0" top="10.0" />
|
||||
</VBox.margin>
|
||||
<children>
|
||||
<Button fx:id="deleteBtn" mnemonicParsing="false" prefHeight="31.0" prefWidth="130.0" text="DELETE" />
|
||||
</children>
|
||||
</HBox>
|
||||
</children>
|
||||
</VBox>
|
||||
</children>
|
||||
</AnchorPane>
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,132 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<?import com.jfoenix.svg.SVGGlyph?>
|
||||
<?import javafx.geometry.Insets?>
|
||||
<?import javafx.scene.control.Button?>
|
||||
<?import javafx.scene.control.Label?>
|
||||
<?import javafx.scene.control.TableColumn?>
|
||||
<?import javafx.scene.control.TableView?>
|
||||
<?import javafx.scene.control.TextField?>
|
||||
<?import javafx.scene.layout.AnchorPane?>
|
||||
<?import javafx.scene.layout.HBox?>
|
||||
<?import javafx.scene.layout.VBox?>
|
||||
<?import javafx.scene.text.Font?>
|
||||
|
||||
<HBox alignment="TOP_CENTER" maxHeight="1.7976931348623157E308" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="600.0" prefWidth="1000.0" stylesheets="@Login.css" xmlns="http://javafx.com/javafx/20.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.example.demo3.AdminPageController">
|
||||
<children>
|
||||
<VBox alignment="TOP_CENTER" maxWidth="300.0" prefHeight="600.0" prefWidth="300.0" spacing="5.0" styleClass="left-form" stylesheets="@Login.css" HBox.hgrow="ALWAYS">
|
||||
<children>
|
||||
<Label styleClass="label-form" stylesheets="@Login.css" text="Welcome">
|
||||
<font>
|
||||
<Font size="19.0" />
|
||||
</font>
|
||||
</Label>
|
||||
<Label fx:id="usernameField" styleClass="label-form" text="Admin">
|
||||
<font>
|
||||
<Font size="13.0" />
|
||||
</font>
|
||||
</Label>
|
||||
<Button fx:id="productsBtn" maxWidth="100.0" mnemonicParsing="false" prefHeight="31.0" prefWidth="100.0" styleClass="label-form" text="Products">
|
||||
<VBox.margin>
|
||||
<Insets top="30.0" />
|
||||
</VBox.margin>
|
||||
</Button>
|
||||
<Button fx:id="depositsBtn" maxWidth="100.0" mnemonicParsing="false" prefHeight="31.0" prefWidth="100.0" styleClass="label-form" text="Deposits">
|
||||
<VBox.margin>
|
||||
<Insets top="10.0" />
|
||||
</VBox.margin>
|
||||
</Button>
|
||||
<Button fx:id="ordersBtn" maxWidth="100.0" mnemonicParsing="false" prefHeight="31.0" prefWidth="100.0" styleClass="label-form" text="Users">
|
||||
<VBox.margin>
|
||||
<Insets top="10.0" />
|
||||
</VBox.margin>
|
||||
</Button>
|
||||
<Button fx:id="routesBtn" maxWidth="100.0" mnemonicParsing="false" prefHeight="31.0" prefWidth="100.0" styleClass="label-form" text="Routes">
|
||||
<VBox.margin>
|
||||
<Insets top="10.0" />
|
||||
</VBox.margin>
|
||||
</Button>
|
||||
<AnchorPane prefHeight="286.0" prefWidth="223.0">
|
||||
<children>
|
||||
<Button fx:id="logoutBtn" layoutX="72.0" layoutY="241.0" mnemonicParsing="false" prefHeight="31.0" prefWidth="79.0" text="Logout" />
|
||||
</children>
|
||||
</AnchorPane>
|
||||
</children>
|
||||
<padding>
|
||||
<Insets top="50.0" />
|
||||
</padding>
|
||||
<HBox.margin>
|
||||
<Insets />
|
||||
</HBox.margin>
|
||||
</VBox>
|
||||
<AnchorPane HBox.hgrow="ALWAYS">
|
||||
<children>
|
||||
<VBox fx:id="rightVBox" alignment="TOP_CENTER" prefHeight="600.0" prefWidth="851.0" stylesheets="@Login.css" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
|
||||
<children>
|
||||
<TextField fx:id="searchBar" maxWidth="300.0" minWidth="100.0" prefWidth="300.0" promptText="search..." styleClass="label-form">
|
||||
<VBox.margin>
|
||||
<Insets bottom="15.0" top="15.0" />
|
||||
</VBox.margin>
|
||||
</TextField>
|
||||
<TableView editable="true" prefHeight="446.0" prefWidth="851.0" stylesheets="@Login.css" VBox.vgrow="ALWAYS">
|
||||
<columns>
|
||||
<TableColumn fx:id="idCol" prefWidth="61.0" text="id" />
|
||||
<TableColumn fx:id="nameCol" prefWidth="218.0" text="name" />
|
||||
<TableColumn fx:id="quantityAvailableCol" prefWidth="218.0" text="quantity available" />
|
||||
<TableColumn fx:id="quantitySelectedCol" prefWidth="147.0" text="selected quantity" />
|
||||
<TableColumn fx:id="selectedCol" prefWidth="192.0" text="selected" />
|
||||
</columns>
|
||||
<columnResizePolicy>
|
||||
<TableView fx:constant="CONSTRAINED_RESIZE_POLICY" />
|
||||
</columnResizePolicy>
|
||||
</TableView>
|
||||
<HBox alignment="CENTER" prefHeight="100.0" prefWidth="200.0">
|
||||
<children>
|
||||
<VBox alignment="CENTER_LEFT" prefHeight="100.0" prefWidth="63.0">
|
||||
<children>
|
||||
<Label text="Name">
|
||||
<VBox.margin>
|
||||
<Insets bottom="10.0" left="10.0" />
|
||||
</VBox.margin>
|
||||
</Label>
|
||||
<Label text="Quantity">
|
||||
<VBox.margin>
|
||||
<Insets left="10.0" />
|
||||
</VBox.margin>
|
||||
</Label>
|
||||
</children>
|
||||
</VBox>
|
||||
<VBox alignment="CENTER_LEFT" prefHeight="200.0" prefWidth="100.0">
|
||||
<children>
|
||||
<TextField fx:id="nameField">
|
||||
<VBox.margin>
|
||||
<Insets bottom="10.0" />
|
||||
</VBox.margin>
|
||||
</TextField>
|
||||
<TextField fx:id="quantityField" />
|
||||
</children>
|
||||
</VBox>
|
||||
<Button fx:id="insertBtn" mnemonicParsing="false" prefHeight="31.0" prefWidth="100.0" text="INSERT">
|
||||
<HBox.margin>
|
||||
<Insets left="50.0" />
|
||||
</HBox.margin>
|
||||
</Button>
|
||||
<Button fx:id="updateBtn" mnemonicParsing="false" prefHeight="31.0" prefWidth="100.0" text="UPDATE">
|
||||
<HBox.margin>
|
||||
<Insets left="50.0" />
|
||||
</HBox.margin>
|
||||
</Button>
|
||||
<Button fx:id="deleteBtn" mnemonicParsing="false" prefHeight="31.0" prefWidth="100.0" text="DELETE">
|
||||
<HBox.margin>
|
||||
<Insets left="50.0" />
|
||||
</HBox.margin>
|
||||
</Button>
|
||||
</children>
|
||||
</HBox>
|
||||
</children>
|
||||
</VBox>
|
||||
</children>
|
||||
</AnchorPane>
|
||||
<SVGGlyph />
|
||||
</children>
|
||||
</HBox>
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,66 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<?import javafx.geometry.Insets?>
|
||||
<?import javafx.scene.control.Button?>
|
||||
<?import javafx.scene.control.Label?>
|
||||
<?import javafx.scene.control.ProgressIndicator?>
|
||||
<?import javafx.scene.control.TableColumn?>
|
||||
<?import javafx.scene.control.TableView?>
|
||||
<?import javafx.scene.control.TextField?>
|
||||
<?import javafx.scene.layout.AnchorPane?>
|
||||
<?import javafx.scene.layout.HBox?>
|
||||
<?import javafx.scene.layout.VBox?>
|
||||
|
||||
<AnchorPane xmlns="http://javafx.com/javafx/20.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.example.demo3.AdminProductsController">
|
||||
<children>
|
||||
<VBox fx:id="rightVBox" alignment="TOP_CENTER" maxHeight="1080.0" stylesheets="@Login.css" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
|
||||
<children>
|
||||
<HBox alignment="CENTER" spacing="15.0">
|
||||
<VBox.margin>
|
||||
<Insets bottom="15.0" top="15.0" />
|
||||
</VBox.margin>
|
||||
<children>
|
||||
<TextField fx:id="searchBar" maxWidth="300.0" minWidth="100.0" prefWidth="300.0" promptText="search..." styleClass="label-form" />
|
||||
<Button fx:id="refreshBtn" mnemonicParsing="false" text="refresh" />
|
||||
<ProgressIndicator fx:id="progressIndicator" progress="0.0" />
|
||||
</children>
|
||||
</HBox>
|
||||
<TableView fx:id="productsTable" editable="true" prefHeight="446.0" prefWidth="851.0" stylesheets="@Login.css" VBox.vgrow="ALWAYS">
|
||||
<columns>
|
||||
<TableColumn fx:id="idCol" prefWidth="61.0" text="id" />
|
||||
<TableColumn fx:id="nameCol" prefWidth="218.0" text="name" />
|
||||
<TableColumn fx:id="selectedCol" prefWidth="192.0" text="selected" />
|
||||
</columns>
|
||||
<columnResizePolicy>
|
||||
<TableView fx:constant="CONSTRAINED_RESIZE_POLICY" />
|
||||
</columnResizePolicy>
|
||||
</TableView>
|
||||
<HBox alignment="CENTER" nodeOrientation="LEFT_TO_RIGHT" prefHeight="100.0" prefWidth="200.0" VBox.vgrow="ALWAYS">
|
||||
<children>
|
||||
<Label text="Name:">
|
||||
<HBox.margin>
|
||||
<Insets right="5.0" />
|
||||
</HBox.margin>
|
||||
</Label>
|
||||
<TextField fx:id="name" />
|
||||
<Button fx:id="insertBtn" mnemonicParsing="false" prefHeight="31.0" prefWidth="100.0" text="INSERT">
|
||||
<HBox.margin>
|
||||
<Insets left="50.0" />
|
||||
</HBox.margin>
|
||||
</Button>
|
||||
<Button fx:id="updateBtn" mnemonicParsing="false" prefHeight="31.0" prefWidth="100.0" text="UPDATE">
|
||||
<HBox.margin>
|
||||
<Insets left="50.0" />
|
||||
</HBox.margin>
|
||||
</Button>
|
||||
<Button fx:id="deleteBtn" mnemonicParsing="false" prefHeight="31.0" prefWidth="100.0" text="DELETE">
|
||||
<HBox.margin>
|
||||
<Insets left="50.0" />
|
||||
</HBox.margin>
|
||||
</Button>
|
||||
</children>
|
||||
</HBox>
|
||||
</children>
|
||||
</VBox>
|
||||
</children>
|
||||
</AnchorPane>
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,111 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<?import javafx.geometry.Insets?>
|
||||
<?import javafx.scene.control.Button?>
|
||||
<?import javafx.scene.control.Label?>
|
||||
<?import javafx.scene.control.ProgressIndicator?>
|
||||
<?import javafx.scene.control.TableColumn?>
|
||||
<?import javafx.scene.control.TableView?>
|
||||
<?import javafx.scene.control.TextField?>
|
||||
<?import javafx.scene.layout.AnchorPane?>
|
||||
<?import javafx.scene.layout.HBox?>
|
||||
<?import javafx.scene.layout.VBox?>
|
||||
|
||||
<AnchorPane xmlns="http://javafx.com/javafx/20.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.example.demo3.AdminRoutesController">
|
||||
<children>
|
||||
<VBox alignment="TOP_CENTER" prefHeight="600.0" prefWidth="864.0" stylesheets="@Login.css" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
|
||||
<children>
|
||||
<HBox alignment="CENTER" spacing="10.0">
|
||||
<VBox.margin>
|
||||
<Insets bottom="15.0" top="15.0" />
|
||||
</VBox.margin>
|
||||
<children>
|
||||
<TextField fx:id="searchBar" maxWidth="300.0" minWidth="100.0" prefWidth="300.0" promptText="search..." styleClass="label-form" />
|
||||
<Button fx:id="refreshBtn" mnemonicParsing="false" text="refresh" />
|
||||
<ProgressIndicator fx:id="progressIndicator" progress="0.0" />
|
||||
</children>
|
||||
</HBox>
|
||||
<AnchorPane prefHeight="440.0" prefWidth="864.0" VBox.vgrow="ALWAYS">
|
||||
<VBox.margin>
|
||||
<Insets />
|
||||
</VBox.margin>
|
||||
<children>
|
||||
<HBox alignment="TOP_CENTER" prefHeight="288.0" prefWidth="864.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
|
||||
<children>
|
||||
<VBox alignment="CENTER" maxWidth="-Infinity" prefHeight="479.0" prefWidth="699.0" HBox.hgrow="ALWAYS">
|
||||
<children>
|
||||
<Label text="ORDERS">
|
||||
<VBox.margin>
|
||||
<Insets bottom="5.0" />
|
||||
</VBox.margin>
|
||||
</Label>
|
||||
<TableView fx:id="ordersTable" editable="true" prefHeight="58.0" prefWidth="227.0" stylesheets="@Login.css" VBox.vgrow="ALWAYS">
|
||||
<columns>
|
||||
<TableColumn fx:id="idOrdersCol" minWidth="0.0" prefWidth="102.0" text="id" />
|
||||
<TableColumn fx:id="coordXOrdersCol" minWidth="0.0" prefWidth="102.0" text="coord X" />
|
||||
<TableColumn fx:id="coordYOrdersCol" minWidth="0.0" prefWidth="102.0" text="coord Y" />
|
||||
<TableColumn fx:id="selectedOrdersCol" minWidth="0.0" prefWidth="102.0" text="select" />
|
||||
</columns>
|
||||
<columnResizePolicy>
|
||||
<TableView fx:constant="CONSTRAINED_RESIZE_POLICY" />
|
||||
</columnResizePolicy>
|
||||
</TableView>
|
||||
<Label text="DEPOSITS">
|
||||
<VBox.margin>
|
||||
<Insets bottom="5.0" top="5.0" />
|
||||
</VBox.margin>
|
||||
</Label>
|
||||
<TableView fx:id="depositsTable" editable="true" prefHeight="174.0" prefWidth="775.0" VBox.vgrow="ALWAYS">
|
||||
<columns>
|
||||
<TableColumn fx:id="idDepositsCol" prefWidth="75.0" text="id" />
|
||||
<TableColumn fx:id="nameDepositsCol" prefWidth="75.0" text="name" />
|
||||
<TableColumn fx:id="coordXDepositsCol" prefWidth="75.0" text="coord X" />
|
||||
<TableColumn fx:id="coordYDepositsCol" prefWidth="75.0" text="coord Y" />
|
||||
</columns>
|
||||
<columnResizePolicy>
|
||||
<TableView fx:constant="CONSTRAINED_RESIZE_POLICY" />
|
||||
</columnResizePolicy>
|
||||
</TableView>
|
||||
</children>
|
||||
</VBox>
|
||||
<VBox alignment="TOP_CENTER" prefHeight="545.0" prefWidth="752.0" HBox.hgrow="ALWAYS">
|
||||
<children>
|
||||
<Label text="PRODUCTS">
|
||||
<VBox.margin>
|
||||
<Insets bottom="5.0" />
|
||||
</VBox.margin>
|
||||
</Label>
|
||||
<TableView fx:id="productsTable" editable="true" prefHeight="457.0" prefWidth="485.0" VBox.vgrow="ALWAYS">
|
||||
<columns>
|
||||
<TableColumn fx:id="idProductCol" prefWidth="95.0" text="id" />
|
||||
<TableColumn fx:id="nameProductCol" prefWidth="351.0" text="name" />
|
||||
<TableColumn fx:id="quantityProductCol" prefWidth="313.0" text="quantity" />
|
||||
</columns>
|
||||
<columnResizePolicy>
|
||||
<TableView fx:constant="CONSTRAINED_RESIZE_POLICY" />
|
||||
</columnResizePolicy>
|
||||
<opaqueInsets>
|
||||
<Insets />
|
||||
</opaqueInsets>
|
||||
</TableView>
|
||||
</children>
|
||||
</VBox>
|
||||
</children>
|
||||
<opaqueInsets>
|
||||
<Insets />
|
||||
</opaqueInsets>
|
||||
</HBox>
|
||||
</children>
|
||||
</AnchorPane>
|
||||
<HBox alignment="CENTER">
|
||||
<VBox.margin>
|
||||
<Insets bottom="10.0" top="10.0" />
|
||||
</VBox.margin>
|
||||
<children>
|
||||
<Button fx:id="deleteRouteBtn" mnemonicParsing="false" prefHeight="31.0" prefWidth="130.0" text="DELETE ROUTE" />
|
||||
</children>
|
||||
</HBox>
|
||||
</children>
|
||||
</VBox>
|
||||
</children>
|
||||
</AnchorPane>
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,20 +0,0 @@
|
||||
.left-form {
|
||||
-fx-background-color: linear-gradient(from 25% 25% to 100% 100%, #0c98d0, #0050ff);
|
||||
-fx-border-color: black;
|
||||
-fx-border-width: 1;
|
||||
}
|
||||
|
||||
.right-form {
|
||||
-fx-border-style: solid solid solid hidden;
|
||||
-fx-border-width: 1;
|
||||
-fx-border-color: black;
|
||||
}
|
||||
|
||||
.label-form {
|
||||
-fx-text-fill: #000000;
|
||||
}
|
||||
|
||||
.left-admin-form{
|
||||
-fx-border-color: black;
|
||||
-fx-border-width: 1;
|
||||
}
|
||||
@@ -1,52 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<?import de.jensd.fx.glyphs.icons525.*?>
|
||||
<?import javafx.geometry.*?>
|
||||
<?import javafx.scene.control.*?>
|
||||
<?import javafx.scene.layout.*?>
|
||||
<?import javafx.scene.text.*?>
|
||||
|
||||
<HBox alignment="CENTER" prefHeight="600.0" prefWidth="1000.0" stylesheets="@Login.css" xmlns="http://javafx.com/javafx/17.0.2-ea" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.example.demo3.LoginController">
|
||||
<children>
|
||||
<VBox alignment="CENTER" prefHeight="600.0" prefWidth="300.0" styleClass="left-form" stylesheets="@Login.css" HBox.hgrow="ALWAYS">
|
||||
<children>
|
||||
<Icons525View glyphName="USER" size="100" text="" />
|
||||
<Label styleClass="label-form" stylesheets="@Login.css" text="Delivery Planner">
|
||||
<font>
|
||||
<Font name="System Bold" size="23.0" />
|
||||
</font>
|
||||
</Label>
|
||||
<Label styleClass="label-form" stylesheets="@Login.css" text="Admin Console">
|
||||
<font>
|
||||
<Font name="System Bold" size="20.0" />
|
||||
</font>
|
||||
</Label>
|
||||
</children>
|
||||
</VBox>
|
||||
<VBox alignment="CENTER" prefHeight="600.0" prefWidth="500.0" spacing="20.0" styleClass="right-form" stylesheets="@Login.css" HBox.hgrow="ALWAYS">
|
||||
<children>
|
||||
<Label styleClass="label-form" stylesheets="@Login.css" text="Welcome Back!">
|
||||
<font>
|
||||
<Font name="System Bold" size="30.0" />
|
||||
</font>
|
||||
</Label>
|
||||
<Label fx:id="errorField" textFill="RED" />
|
||||
<TextField fx:id="email" maxWidth="200.0" prefHeight="34.0" prefWidth="149.0" promptText="email" />
|
||||
<PasswordField fx:id="password" maxWidth="200.0" prefHeight="34.0" prefWidth="149.0" promptText="password" />
|
||||
<Button fx:id="loginBtn" maxWidth="200.0" mnemonicParsing="false" prefHeight="34.0" prefWidth="149.0" styleClass="label-form" text="login">
|
||||
<font>
|
||||
<Font name="System Bold" size="12.0" />
|
||||
</font>
|
||||
</Button>
|
||||
<Label fx:id="loading" maxWidth="200.0" prefHeight="34.0" prefWidth="200.0">
|
||||
<VBox.margin>
|
||||
<Insets bottom="-20.0" />
|
||||
</VBox.margin></Label>
|
||||
<ProgressBar fx:id="progressBar" prefWidth="200.0" progress="0.0" VBox.vgrow="ALWAYS" />
|
||||
</children>
|
||||
<padding>
|
||||
<Insets left="30.0" right="30.0" />
|
||||
</padding>
|
||||
</VBox>
|
||||
</children>
|
||||
</HBox>
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,7 +0,0 @@
|
||||
.vbox{
|
||||
-fx-background-color: linear-gradient(from 25% 25% to 100% 100%, #0c98d0, #0050ff);
|
||||
}
|
||||
|
||||
.text{
|
||||
-fx-text-fill: #000000;
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
@@ -1,61 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<?import javafx.geometry.Insets?>
|
||||
<?import javafx.scene.control.TableColumn?>
|
||||
<?import javafx.scene.control.TableView?>
|
||||
<?import javafx.scene.control.TextField?>
|
||||
<?import javafx.scene.layout.AnchorPane?>
|
||||
<?import javafx.scene.layout.HBox?>
|
||||
<?import javafx.scene.layout.VBox?>
|
||||
|
||||
<AnchorPane xmlns="http://javafx.com/javafx/20.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.example.demo3.UserOrdersController">
|
||||
<children>
|
||||
<VBox alignment="TOP_CENTER" prefHeight="600.0" prefWidth="864.0" stylesheets="@Login.css" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
|
||||
<children>
|
||||
<TextField fx:id="searchBar" maxWidth="300.0" minWidth="100.0" prefWidth="300.0" promptText="search..." styleClass="label-form">
|
||||
<VBox.margin>
|
||||
<Insets bottom="15.0" top="15.0" />
|
||||
</VBox.margin>
|
||||
</TextField>
|
||||
<AnchorPane VBox.vgrow="ALWAYS">
|
||||
<VBox.margin>
|
||||
<Insets />
|
||||
</VBox.margin>
|
||||
<children>
|
||||
<HBox alignment="TOP_CENTER" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
|
||||
<children>
|
||||
<TableView fx:id="ordersTable" editable="true" prefHeight="545.0" prefWidth="47.0" stylesheets="@Login.css" HBox.hgrow="ALWAYS">
|
||||
<columns>
|
||||
<TableColumn fx:id="idOrderCol" minWidth="0.0" prefWidth="102.0" text="order id" />
|
||||
</columns>
|
||||
<columnResizePolicy>
|
||||
<TableView fx:constant="CONSTRAINED_RESIZE_POLICY" />
|
||||
</columnResizePolicy>
|
||||
<HBox.margin>
|
||||
<Insets right="15.0" />
|
||||
</HBox.margin>
|
||||
</TableView>
|
||||
<TableView fx:id="productsTable" editable="true" prefHeight="723.0" prefWidth="685.0" HBox.hgrow="ALWAYS">
|
||||
<columns>
|
||||
<TableColumn fx:id="idProductCol" prefWidth="95.0" text="id" />
|
||||
<TableColumn fx:id="nameProductCol" prefWidth="351.0" text="name" />
|
||||
<TableColumn fx:id="quantityProductCol" prefWidth="313.0" text="quantity" />
|
||||
</columns>
|
||||
<columnResizePolicy>
|
||||
<TableView fx:constant="CONSTRAINED_RESIZE_POLICY" />
|
||||
</columnResizePolicy>
|
||||
<opaqueInsets>
|
||||
<Insets />
|
||||
</opaqueInsets>
|
||||
</TableView>
|
||||
</children>
|
||||
<opaqueInsets>
|
||||
<Insets />
|
||||
</opaqueInsets>
|
||||
</HBox>
|
||||
</children>
|
||||
</AnchorPane>
|
||||
</children>
|
||||
</VBox>
|
||||
</children>
|
||||
</AnchorPane>
|
||||
Binary file not shown.
Binary file not shown.
@@ -1,42 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<?import javafx.geometry.Insets?>
|
||||
<?import javafx.scene.control.Button?>
|
||||
<?import javafx.scene.control.ProgressIndicator?>
|
||||
<?import javafx.scene.control.TableColumn?>
|
||||
<?import javafx.scene.control.TableView?>
|
||||
<?import javafx.scene.control.TextField?>
|
||||
<?import javafx.scene.layout.HBox?>
|
||||
<?import javafx.scene.layout.VBox?>
|
||||
|
||||
<VBox fx:id="rightVBox" alignment="TOP_CENTER" prefHeight="600.0" prefWidth="864.0" stylesheets="@Login.css" xmlns="http://javafx.com/javafx/20.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.example.demo3.UserProductsController">
|
||||
<children>
|
||||
<HBox alignment="CENTER" spacing="10.0">
|
||||
<VBox.margin>
|
||||
<Insets bottom="15.0" top="15.0" />
|
||||
</VBox.margin>
|
||||
<children>
|
||||
<TextField fx:id="searchBar" maxWidth="300.0" minWidth="100.0" prefWidth="300.0" promptText="search..." styleClass="label-form" />
|
||||
<Button fx:id="refreshBtn" mnemonicParsing="false" text="refresh" HBox.hgrow="ALWAYS" />
|
||||
<ProgressIndicator fx:id="progressIndicator" prefWidth="27.0" progress="0.0" />
|
||||
</children>
|
||||
</HBox>
|
||||
<TableView fx:id="productsTable" editable="true" prefHeight="446.0" prefWidth="851.0" stylesheets="@Login.css" VBox.vgrow="ALWAYS">
|
||||
<columns>
|
||||
<TableColumn fx:id="idCol" prefWidth="61.0" text="id" />
|
||||
<TableColumn fx:id="nameCol" prefWidth="218.0" text="name" />
|
||||
<TableColumn fx:id="quantityAvailableCol" prefWidth="218.0" text="quantity available" />
|
||||
<TableColumn fx:id="selectedCol" prefWidth="192.0" text="selected" />
|
||||
<TableColumn fx:id="selectedQuantityCol" prefWidth="147.0" text="selected quantity" />
|
||||
</columns>
|
||||
<columnResizePolicy>
|
||||
<TableView fx:constant="CONSTRAINED_RESIZE_POLICY" />
|
||||
</columnResizePolicy>
|
||||
</TableView>
|
||||
<Button fx:id="placeOrderBtn" maxWidth="100.0" mnemonicParsing="false" prefHeight="31.0" prefWidth="100.0" styleClass="label-form" text="Place Order">
|
||||
<VBox.margin>
|
||||
<Insets bottom="15.0" top="15.0" />
|
||||
</VBox.margin>
|
||||
</Button>
|
||||
</children>
|
||||
</VBox>
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
-27
@@ -1,27 +0,0 @@
|
||||
com\example\demo3\interfaces\JSONMethods.class
|
||||
com\example\demo3\AdminPageController$3.class
|
||||
com\example\demo3\ServerConnection.class
|
||||
com\example\demo3\LoginController.class
|
||||
com\example\demo3\StagesPaths.class
|
||||
com\example\demo3\items\database\TableUser.class
|
||||
com\example\demo3\items\BaseItem.class
|
||||
com\example\demo3\json\JsonFields.class
|
||||
com\example\demo3\AdminRoutesController.class
|
||||
com\example\demo3\AdminOrdersController.class
|
||||
com\example\demo3\AdminLoginController$1.class
|
||||
com\example\demo3\AdminPageController$2.class
|
||||
com\example\demo3\AdminDepositsController.class
|
||||
com\example\demo3\WriteAndReadUtil.class
|
||||
com\example\demo3\FxmlLoader.class
|
||||
com\example\demo3\items\ProductForOrder.class
|
||||
com\example\demo3\LoginController$1.class
|
||||
com\example\demo3\AdminPageController.class
|
||||
com\example\demo3\AdminLoginController.class
|
||||
com\example\demo3\items\Order.class
|
||||
com\example\demo3\items\database\TableOrder.class
|
||||
com\example\demo3\UserOrdersController.class
|
||||
com\example\demo3\AdminProductsController.class
|
||||
com\example\demo3\Main.class
|
||||
com\example\demo3\items\AdminJson.class
|
||||
com\example\demo3\AdminPageController$1.class
|
||||
com\example\demo3\AdminPageController$4.class
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user