inicio repo Sist.V.LSR
This commit is contained in:
commit
091df3d229
8
README.md
Normal file
8
README.md
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
## Sistema De Ventas (GUI)
|
||||||
|
Aplicación utílizada con un lector de códigos de barra, se puede usar teclado.
|
||||||
|
Boleta simulada en consola.
|
||||||
|
|
||||||
|
Descargas:
|
||||||
|
- []()
|
||||||
|
- []()
|
||||||
|
|
73
build.xml
Normal file
73
build.xml
Normal file
@ -0,0 +1,73 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!-- You may freely edit this file. See commented blocks below for -->
|
||||||
|
<!-- some examples of how to customize the build. -->
|
||||||
|
<!-- (If you delete it and reopen the project it will be recreated.) -->
|
||||||
|
<!-- By default, only the Clean and Build commands use this build script. -->
|
||||||
|
<!-- Commands such as Run, Debug, and Test only use this build script if -->
|
||||||
|
<!-- the Compile on Save feature is turned off for the project. -->
|
||||||
|
<!-- You can turn off the Compile on Save (or Deploy on Save) setting -->
|
||||||
|
<!-- in the project's Project Properties dialog box.-->
|
||||||
|
<project name="Sistema_de_Ventas_LSR_Pi" default="default" basedir=".">
|
||||||
|
<description>Builds, tests, and runs the project Sistema_de_Ventas_LSR_Pi.</description>
|
||||||
|
<import file="nbproject/build-impl.xml"/>
|
||||||
|
<!--
|
||||||
|
|
||||||
|
There exist several targets which are by default empty and which can be
|
||||||
|
used for execution of your tasks. These targets are usually executed
|
||||||
|
before and after some main targets. They are:
|
||||||
|
|
||||||
|
-pre-init: called before initialization of project properties
|
||||||
|
-post-init: called after initialization of project properties
|
||||||
|
-pre-compile: called before javac compilation
|
||||||
|
-post-compile: called after javac compilation
|
||||||
|
-pre-compile-single: called before javac compilation of single file
|
||||||
|
-post-compile-single: called after javac compilation of single file
|
||||||
|
-pre-compile-test: called before javac compilation of JUnit tests
|
||||||
|
-post-compile-test: called after javac compilation of JUnit tests
|
||||||
|
-pre-compile-test-single: called before javac compilation of single JUnit test
|
||||||
|
-post-compile-test-single: called after javac compilation of single JUunit test
|
||||||
|
-pre-jar: called before JAR building
|
||||||
|
-post-jar: called after JAR building
|
||||||
|
-post-clean: called after cleaning build products
|
||||||
|
|
||||||
|
(Targets beginning with '-' are not intended to be called on their own.)
|
||||||
|
|
||||||
|
Example of inserting an obfuscator after compilation could look like this:
|
||||||
|
|
||||||
|
<target name="-post-compile">
|
||||||
|
<obfuscate>
|
||||||
|
<fileset dir="${build.classes.dir}"/>
|
||||||
|
</obfuscate>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
For list of available properties check the imported
|
||||||
|
nbproject/build-impl.xml file.
|
||||||
|
|
||||||
|
|
||||||
|
Another way to customize the build is by overriding existing main targets.
|
||||||
|
The targets of interest are:
|
||||||
|
|
||||||
|
-init-macrodef-javac: defines macro for javac compilation
|
||||||
|
-init-macrodef-junit: defines macro for junit execution
|
||||||
|
-init-macrodef-debug: defines macro for class debugging
|
||||||
|
-init-macrodef-java: defines macro for class execution
|
||||||
|
-do-jar: JAR building
|
||||||
|
run: execution of project
|
||||||
|
-javadoc-build: Javadoc generation
|
||||||
|
test-report: JUnit report generation
|
||||||
|
|
||||||
|
An example of overriding the target for project execution could look like this:
|
||||||
|
|
||||||
|
<target name="run" depends="Sistema_de_Ventas_LSR_Pi-impl.jar">
|
||||||
|
<exec dir="bin" executable="launcher.exe">
|
||||||
|
<arg file="${dist.jar}"/>
|
||||||
|
</exec>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
Notice that the overridden target depends on the jar target and not only on
|
||||||
|
the compile target as the regular run target does. Again, for a list of available
|
||||||
|
properties which you can use, check the target you are overriding in the
|
||||||
|
nbproject/build-impl.xml file.
|
||||||
|
|
||||||
|
-->
|
||||||
|
</project>
|
BIN
lib/AbsoluteLayout.jar
Normal file
BIN
lib/AbsoluteLayout.jar
Normal file
Binary file not shown.
BIN
lib/JTattoo-1.6.11.jar
Normal file
BIN
lib/JTattoo-1.6.11.jar
Normal file
Binary file not shown.
3
manifest.mf
Normal file
3
manifest.mf
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
Manifest-Version: 1.0
|
||||||
|
X-COMMENT: Main-Class will be added automatically by build
|
||||||
|
|
1769
nbproject/build-impl.xml
Normal file
1769
nbproject/build-impl.xml
Normal file
File diff suppressed because it is too large
Load Diff
2
nbproject/configs/ConfigRemotePi.properties
Normal file
2
nbproject/configs/ConfigRemotePi.properties
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
compile.on.save.unsupported.remote.platform=true
|
||||||
|
debug-transport=dt_socket
|
8
nbproject/genfiles.properties
Normal file
8
nbproject/genfiles.properties
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
build.xml.data.CRC32=2de7ada0
|
||||||
|
build.xml.script.CRC32=04a34e5f
|
||||||
|
build.xml.stylesheet.CRC32=f85dc8f2@1.90.1.48
|
||||||
|
# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
|
||||||
|
# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
|
||||||
|
nbproject/build-impl.xml.data.CRC32=2de7ada0
|
||||||
|
nbproject/build-impl.xml.script.CRC32=e288e195
|
||||||
|
nbproject/build-impl.xml.stylesheet.CRC32=3a2fa800@1.90.1.48
|
0
nbproject/private/config.properties
Normal file
0
nbproject/private/config.properties
Normal file
8
nbproject/private/private.properties
Normal file
8
nbproject/private/private.properties
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
compile.on.save=true
|
||||||
|
do.depend=false
|
||||||
|
do.jar=true
|
||||||
|
do.jlink=false
|
||||||
|
javac.debug=true
|
||||||
|
javadoc.preview=true
|
||||||
|
jlink.strip=false
|
||||||
|
user.properties.file=/home/fuzantoko/.netbeans/10.0/build.properties
|
4
nbproject/private/private.xml
Normal file
4
nbproject/private/private.xml
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project-private xmlns="http://www.netbeans.org/ns/project-private/1">
|
||||||
|
<editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/2" lastBookmarkId="0"/>
|
||||||
|
</project-private>
|
117
nbproject/project.properties
Normal file
117
nbproject/project.properties
Normal file
@ -0,0 +1,117 @@
|
|||||||
|
annotation.processing.enabled=true
|
||||||
|
annotation.processing.enabled.in.editor=false
|
||||||
|
annotation.processing.processors.list=
|
||||||
|
annotation.processing.run.all.processors=true
|
||||||
|
annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output
|
||||||
|
application.desc=
|
||||||
|
application.homepage=jpdev.kickto.net
|
||||||
|
application.title=Sistema_de_Ventas_LSR_Pi
|
||||||
|
application.vendor=jp.av.dev@gmail.com
|
||||||
|
auxiliary.org-netbeans-spi-editor-hints-projects.perProjectHintSettingsFile=nbproject/cfg_hints.xml
|
||||||
|
build.classes.dir=${build.dir}/classes
|
||||||
|
build.classes.excludes=**/*.java,**/*.form
|
||||||
|
# This directory is removed when the project is cleaned:
|
||||||
|
build.dir=build
|
||||||
|
build.generated.dir=${build.dir}/generated
|
||||||
|
build.generated.sources.dir=${build.dir}/generated-sources
|
||||||
|
# Only compile against the classpath explicitly listed here:
|
||||||
|
build.sysclasspath=ignore
|
||||||
|
build.test.classes.dir=${build.dir}/test/classes
|
||||||
|
build.test.results.dir=${build.dir}/test/results
|
||||||
|
# Uncomment to specify the preferred debugger connection transport:
|
||||||
|
#debug.transport=dt_socket
|
||||||
|
debug.classpath=\
|
||||||
|
${run.classpath}
|
||||||
|
debug.modulepath=\
|
||||||
|
${run.modulepath}
|
||||||
|
debug.test.classpath=\
|
||||||
|
${run.test.classpath}
|
||||||
|
debug.test.modulepath=\
|
||||||
|
${run.test.modulepath}
|
||||||
|
# Files in build.classes.dir which should be excluded from distribution jar
|
||||||
|
dist.archive.excludes=
|
||||||
|
# This directory is removed when the project is cleaned:
|
||||||
|
dist.dir=dist
|
||||||
|
dist.jar=${dist.dir}/Sistema_de_Ventas_LSR_Pi.jar
|
||||||
|
dist.javadoc.dir=${dist.dir}/javadoc
|
||||||
|
endorsed.classpath=
|
||||||
|
excludes=
|
||||||
|
file.reference.AbsoluteLayout.jar=lib/AbsoluteLayout.jar
|
||||||
|
file.reference.JTattoo-1.6.11.jar=lib/JTattoo-1.6.11.jar
|
||||||
|
includes=**
|
||||||
|
jar.archive.disabled=${jnlp.enabled}
|
||||||
|
jar.compress=false
|
||||||
|
jar.index=${jnlp.enabled}
|
||||||
|
javac.classpath=\
|
||||||
|
${file.reference.AbsoluteLayout.jar}:\
|
||||||
|
${file.reference.JTattoo-1.6.11.jar}
|
||||||
|
# Space-separated list of extra javac options
|
||||||
|
javac.compilerargs=
|
||||||
|
javac.deprecation=false
|
||||||
|
javac.external.vm=true
|
||||||
|
javac.modulepath=
|
||||||
|
javac.processormodulepath=
|
||||||
|
javac.processorpath=\
|
||||||
|
${javac.classpath}
|
||||||
|
javac.source=1.8
|
||||||
|
javac.target=1.8
|
||||||
|
javac.test.classpath=\
|
||||||
|
${javac.classpath}:\
|
||||||
|
${build.classes.dir}
|
||||||
|
javac.test.modulepath=\
|
||||||
|
${javac.modulepath}
|
||||||
|
javac.test.processorpath=\
|
||||||
|
${javac.test.classpath}
|
||||||
|
javadoc.additionalparam=
|
||||||
|
javadoc.author=false
|
||||||
|
javadoc.encoding=${source.encoding}
|
||||||
|
javadoc.html5=false
|
||||||
|
javadoc.noindex=false
|
||||||
|
javadoc.nonavbar=false
|
||||||
|
javadoc.notree=false
|
||||||
|
javadoc.private=false
|
||||||
|
javadoc.splitindex=true
|
||||||
|
javadoc.use=true
|
||||||
|
javadoc.version=false
|
||||||
|
javadoc.windowtitle=
|
||||||
|
jlink.launcher=false
|
||||||
|
jlink.launcher.name=Sistema_de_Ventas_LSR_Pi
|
||||||
|
jnlp.codebase.type=no.codebase
|
||||||
|
jnlp.descriptor=application
|
||||||
|
jnlp.enabled=false
|
||||||
|
jnlp.mixed.code=default
|
||||||
|
jnlp.offline-allowed=false
|
||||||
|
jnlp.signed=false
|
||||||
|
jnlp.signing=
|
||||||
|
jnlp.signing.alias=
|
||||||
|
jnlp.signing.keystore=
|
||||||
|
main.class=sistema_de_ventas_lsr.Sistema_de_Ventas_LSR
|
||||||
|
# Optional override of default Application-Library-Allowable-Codebase attribute identifying the locations where your signed RIA is expected to be found.
|
||||||
|
manifest.custom.application.library.allowable.codebase=
|
||||||
|
# Optional override of default Caller-Allowable-Codebase attribute identifying the domains from which JavaScript code can make calls to your RIA without security prompts.
|
||||||
|
manifest.custom.caller.allowable.codebase=
|
||||||
|
# Optional override of default Codebase manifest attribute, use to prevent RIAs from being repurposed
|
||||||
|
manifest.custom.codebase=
|
||||||
|
# Optional override of default Permissions manifest attribute (supported values: sandbox, all-permissions)
|
||||||
|
manifest.custom.permissions=
|
||||||
|
manifest.file=manifest.mf
|
||||||
|
meta.inf.dir=${src.dir}/META-INF
|
||||||
|
mkdist.disabled=false
|
||||||
|
platform.active=default_platform
|
||||||
|
run.classpath=\
|
||||||
|
${javac.classpath}:\
|
||||||
|
${build.classes.dir}
|
||||||
|
# Space-separated list of JVM arguments used when running the project.
|
||||||
|
# You may also define separate properties like run-sys-prop.name=value instead of -Dname=value.
|
||||||
|
# To set system properties for unit tests define test-sys-prop.name=value:
|
||||||
|
run.jvmargs=
|
||||||
|
run.modulepath=\
|
||||||
|
${javac.modulepath}
|
||||||
|
run.test.classpath=\
|
||||||
|
${javac.test.classpath}:\
|
||||||
|
${build.test.classes.dir}
|
||||||
|
run.test.modulepath=\
|
||||||
|
${javac.test.modulepath}
|
||||||
|
source.encoding=UTF-8
|
||||||
|
src.dir=src
|
||||||
|
test.src.dir=test
|
18
nbproject/project.xml
Normal file
18
nbproject/project.xml
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xmlns="http://www.netbeans.org/ns/project/1">
|
||||||
|
<type>org.netbeans.modules.java.j2seproject</type>
|
||||||
|
<configuration>
|
||||||
|
<buildExtensions xmlns="http://www.netbeans.org/ns/ant-build-extender/1">
|
||||||
|
<extension file="remote-platform-impl.xml" id="remote-platform-1"/>
|
||||||
|
</buildExtensions>
|
||||||
|
<data xmlns="http://www.netbeans.org/ns/j2se-project/3">
|
||||||
|
<name>Sistema_de_Ventas_LSR_Pi</name>
|
||||||
|
<source-roots>
|
||||||
|
<root id="src.dir"/>
|
||||||
|
</source-roots>
|
||||||
|
<test-roots>
|
||||||
|
<root id="test.src.dir"/>
|
||||||
|
</test-roots>
|
||||||
|
</data>
|
||||||
|
</configuration>
|
||||||
|
</project>
|
234
nbproject/remote-platform-impl.xml
Normal file
234
nbproject/remote-platform-impl.xml
Normal file
@ -0,0 +1,234 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!--
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
|
http://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.
|
||||||
|
|
||||||
|
-->
|
||||||
|
|
||||||
|
<project default="default" basedir=".." xmlns:remote="http://www.netbeans.org/ns/j2se-project/remote-platform/1" xmlns:j2seproject1="http://www.netbeans.org/ns/j2se-project/1" xmlns:j2seproject3="http://www.netbeans.org/ns/j2se-project/3">
|
||||||
|
|
||||||
|
<target name="default">
|
||||||
|
<echo message="Default target is not set, you must specify which target you want to run."/>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="-init-remote-platform-properties" depends="init">
|
||||||
|
<fail unless="platform.runtime">Runtime platform (platform.runtime) must be set.</fail>
|
||||||
|
<j2seproject1:property name="remote.platform.home.dir" value="platforms.${platform.runtime}.platform.install.folder"/>
|
||||||
|
<j2seproject1:property name="remote.platform.work.dir" value="platforms.${platform.runtime}.platform.work.folder"/>
|
||||||
|
<j2seproject1:property name="remote.platform.host" value="platforms.${platform.runtime}.platform.host"/>
|
||||||
|
<j2seproject1:property name="remote.platform.port" value="platforms.${platform.runtime}.platform.port"/>
|
||||||
|
<j2seproject1:property name="remote.platform.user" value="platforms.${platform.runtime}.platform.auth.username"/>
|
||||||
|
<j2seproject1:property name="remote.platform.auth" value="platforms.${platform.runtime}.platform.auth.kind"/>
|
||||||
|
<j2seproject1:property name="remote.platform.keyfile" value="platforms.${platform.runtime}.platform.auth.keystore"/>
|
||||||
|
<j2seproject1:property name="remote.platform.exec.decorator" value="platforms.${platform.runtime}.platform.exec.decorator"/>
|
||||||
|
<fail unless="remote.platform.home.dir">Must set remote.platform.home.dir</fail>
|
||||||
|
<fail unless="remote.platform.work.dir">Must set remote.platform.work.dir</fail>
|
||||||
|
<fail unless="remote.platform.host">Must set remote.platform.host</fail>
|
||||||
|
<fail unless="remote.platform.port">Must set remote.platform.port</fail>
|
||||||
|
<fail unless="remote.platform.user">Must set remote.platform.user</fail>
|
||||||
|
<fail unless="remote.platform.auth">Must set remote.platform.auth</fail>
|
||||||
|
<condition property="remote.platform.auth.passwd">
|
||||||
|
<equals arg1="${remote.platform.auth}" arg2="PASSWORD"/>
|
||||||
|
</condition>
|
||||||
|
<condition property="remote.platform.auth.key">
|
||||||
|
<equals arg1="${remote.platform.auth}" arg2="KEY"/>
|
||||||
|
</condition>
|
||||||
|
<basename file="${basedir}" property="remote.project.name"/>
|
||||||
|
<basename file="${dist.dir}" property="remote.dist.dir.name"/>
|
||||||
|
<basename file="${dist.jar}" property="remote.dist.jar.name"/>
|
||||||
|
<property name="remote.project.dir" value="${remote.platform.work.dir}/${remote.project.name}"/>
|
||||||
|
<property name="remote.dist.dir" value="${remote.project.dir}/${remote.dist.dir.name}"/>
|
||||||
|
<property name="remote.dist.jar" value="${remote.dist.dir}/${remote.dist.jar.name}"/>
|
||||||
|
<property name="remote.java.executable" value="${remote.platform.home.dir}/bin/java"/>
|
||||||
|
<scriptdef name="addressport" language="javascript">
|
||||||
|
<attribute name="address" />
|
||||||
|
<attribute name="property" />
|
||||||
|
<![CDATA[
|
||||||
|
var address = attributes.get("address");
|
||||||
|
project.setProperty(attributes.get("property"), address.split(":")[1]);
|
||||||
|
]]>
|
||||||
|
</scriptdef>
|
||||||
|
<condition property="remote.platform.exec.prefix" value="'${remote.platform.exec.decorator}' " else="">
|
||||||
|
<not>
|
||||||
|
<equals arg1="${remote.platform.exec.decorator}" arg2="$${platforms.${platform.runtime}.platform.exec.decorator}"/>
|
||||||
|
</not>
|
||||||
|
</condition>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="-copy-to-remote-platform">
|
||||||
|
<macrodef name="runwithpasswd" uri="http://www.netbeans.org/ns/j2se-project/remote-platform/1">
|
||||||
|
<attribute name="additionaljvmargs" default=""/>
|
||||||
|
<sequential>
|
||||||
|
<sshexec host="${remote.platform.host}" port="${remote.platform.port}" username="${remote.platform.user}" password="${remote.platform.password}" trust="true" command="mkdir -p '${remote.dist.dir}'"/>
|
||||||
|
<scp todir="${remote.platform.user}@${remote.platform.host}:${remote.dist.dir}" port="${remote.platform.port}" password="${remote.platform.password}" trust="true">
|
||||||
|
<fileset dir="${dist.dir}"/>
|
||||||
|
</scp>
|
||||||
|
<antcall target="profile-rp-calibrate-passwd"/>
|
||||||
|
<sshexec host="${remote.platform.host}" port="${remote.platform.port}" username="${remote.platform.user}" password="${remote.platform.password}" trust="true" usepty="true"
|
||||||
|
command="cd '${remote.project.dir}'; ${remote.platform.exec.prefix}'${remote.java.executable}' @{additionaljvmargs} -Dfile.encoding=${runtime.encoding} ${run.jvmargs} ${run.jvmargs.ide} -jar ${remote.dist.jar} ${application.args}"/>
|
||||||
|
</sequential>
|
||||||
|
</macrodef>
|
||||||
|
<macrodef name="runwithkey" uri="http://www.netbeans.org/ns/j2se-project/remote-platform/1">
|
||||||
|
<attribute name="additionaljvmargs" default=""/>
|
||||||
|
<sequential>
|
||||||
|
<fail unless="remote.platform.keyfile">Must set remote.platform.keyfile</fail>
|
||||||
|
<sshexec host="${remote.platform.host}" port="${remote.platform.port}" username="${remote.platform.user}" keyfile="${remote.platform.keyfile}" passphrase="${remote.platform.passphrase}" trust="true" command="mkdir -p '${remote.dist.dir}'"/>
|
||||||
|
<scp todir="${remote.platform.user}@${remote.platform.host}:${remote.dist.dir}" port="${remote.platform.port}" keyfile="${remote.platform.keyfile}" passphrase="${remote.platform.passphrase}" trust="true">
|
||||||
|
<fileset dir="${dist.dir}"/>
|
||||||
|
</scp>
|
||||||
|
<antcall target="profile-rp-calibrate-key"/>
|
||||||
|
<sshexec host="${remote.platform.host}" port="${remote.platform.port}" username="${remote.platform.user}" keyfile="${remote.platform.keyfile}" passphrase="${remote.platform.passphrase}" trust="true" usepty="true"
|
||||||
|
command="cd '${remote.project.dir}'; ${remote.platform.exec.prefix}'${remote.java.executable}' @{additionaljvmargs} -Dfile.encoding=${runtime.encoding} ${run.jvmargs} ${run.jvmargs.ide} -jar ${remote.dist.jar} ${application.args}"/>
|
||||||
|
</sequential>
|
||||||
|
</macrodef>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="-check-vm-debug" depends="init, -init-remote-platform-properties, -copy-to-remote-platform">
|
||||||
|
<j2seproject1:property name="remote.platform.jvm.debug" value="platforms.${platform.runtime}.platform.jvm.debug"/>
|
||||||
|
<condition property="remote.platform.jvm.debug.available" value="true">
|
||||||
|
<or>
|
||||||
|
<contains string="${remote.platform.jvm.debug}" substring="$${platforms."/>
|
||||||
|
<istrue value="${remote.platform.jvm.debug}"/>
|
||||||
|
</or>
|
||||||
|
</condition>
|
||||||
|
<fail unless="remote.platform.jvm.debug.available" message="The Runtime JVM ${remote.platform.host}:${remote.platform.home.dir} does not support debugging."/>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="-ask-password" unless="remote.platform.password" if="remote.platform.auth.passwd">
|
||||||
|
<input message="Password ${remote.platform.user}@${remote.platform.host}:" addproperty="remote.platform.password">
|
||||||
|
<handler type="secure"/>
|
||||||
|
</input>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="-ask-passphrase" unless="remote.platform.passphrase" if="remote.platform.auth.key">
|
||||||
|
<input message="Passphrase ${remote.platform.user}@${remote.platform.host}:" addproperty="remote.platform.passphrase">
|
||||||
|
<handler type="secure"/>
|
||||||
|
</input>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="-run-remote-passwd" depends="init, jar, -init-remote-platform-properties, -copy-to-remote-platform, -ask-password" if="remote.platform.auth.passwd">
|
||||||
|
<remote:runwithpasswd/>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="-debug-remote-passwd" depends="init, jar, -init-remote-platform-properties, -copy-to-remote-platform, -ask-password, -debug-start-debugger" if="remote.platform.auth.passwd">
|
||||||
|
<addressport address="${jpda.address}" property="jpda.port"/>
|
||||||
|
<sshsession host="${remote.platform.host}" port="${remote.platform.port}" username="${remote.platform.user}" password="${remote.platform.password}" trust="true">
|
||||||
|
<remotetunnel lport="${jpda.port}" lhost="localhost" rport="${jpda.port}"/>
|
||||||
|
<sequential>
|
||||||
|
<remote:runwithpasswd additionaljvmargs="${debug-args-line} -Xrunjdwp:transport=${debug-transport},address=${jpda.address}"/>
|
||||||
|
</sequential>
|
||||||
|
</sshsession>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="-run-remote-key" depends="init, jar, -init-remote-platform-properties, -copy-to-remote-platform, -ask-passphrase" if="remote.platform.auth.key">
|
||||||
|
<remote:runwithkey/>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="-debug-remote-key" depends="init, jar, -init-remote-platform-properties, -copy-to-remote-platform, -ask-passphrase, -debug-start-debugger" if="remote.platform.auth.key">
|
||||||
|
<addressport address="${jpda.address}" property="jpda.port"/>
|
||||||
|
<sshsession host="${remote.platform.host}" port="${remote.platform.port}" username="${remote.platform.user}" keyfile="${remote.platform.keyfile}" passphrase="${remote.platform.passphrase}" trust="true">
|
||||||
|
<remotetunnel lport="${jpda.port}" lhost="localhost" rport="${jpda.port}"/>
|
||||||
|
<sequential>
|
||||||
|
<remote:runwithkey additionaljvmargs="${debug-args-line} -Xrunjdwp:transport=${debug-transport},address=${jpda.address}"/>
|
||||||
|
</sequential>
|
||||||
|
</sshsession>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="profile-clean-rp" depends="profile-rp-renew-local-calibration" if="profiling.started">
|
||||||
|
<delete dir="${dist.dir}/remotepack"/>
|
||||||
|
<delete file="${user.home}/.nbprofiler/machinedata.jdk${remote.platform.java.spec.ver}.${remote.platform.host}.new"/>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="profile-rp-renew-local-check">
|
||||||
|
<condition property="profiler.calibration.local-remote.replace">
|
||||||
|
<and>
|
||||||
|
<available file="${user.home}/.nbprofiler/machinedata.jdk${remote.platform.java.spec.ver}.${remote.platform.host}.new" type="file"/>
|
||||||
|
<not>
|
||||||
|
<filesmatch
|
||||||
|
file1="${user.home}/.nbprofiler/machinedata.jdk${remote.platform.java.spec.ver}.${remote.platform.host}"
|
||||||
|
file2="${user.home}/.nbprofiler/machinedata.jdk${remote.platform.java.spec.ver}.${remote.platform.host}.new"/>
|
||||||
|
</not>
|
||||||
|
</and>
|
||||||
|
</condition>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="profile-rp-renew-local-calibration" depends="profile-rp-renew-local-check" if="profiler.calibration.local-remote.replace">
|
||||||
|
<move
|
||||||
|
file="${user.home}/.nbprofiler/machinedata.jdk${remote.platform.java.spec.ver}.${remote.platform.host}.new"
|
||||||
|
tofile="${user.home}/.nbprofiler/machinedata.jdk${remote.platform.java.spec.ver}.${remote.platform.host}"
|
||||||
|
force="true"
|
||||||
|
verbose="true"/>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="profile-rp-unzip" if="profiling.started" depends="profile-rp-create">
|
||||||
|
<unzip src="${java.io.tmpdir}/profiler-server-${remote.platform.rp.filename}.zip" dest="${dist.dir}/remotepack"/>
|
||||||
|
<chmod perm="a+x">
|
||||||
|
<fileset dir="${dist.dir}/remotepack">
|
||||||
|
<include name="**/*.so"/>
|
||||||
|
<include name="**/*.dll"/>
|
||||||
|
<include name="**/*.sh"/>
|
||||||
|
<include name="**/*.jnilib"/>
|
||||||
|
<exclude name="**/*.jar"/>
|
||||||
|
</fileset>
|
||||||
|
</chmod>
|
||||||
|
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="profile-rp-create" if="profiling.started">
|
||||||
|
<property name="profile.cluster" value="${netbeans.home}/../profiler"/>
|
||||||
|
<ant dir="${profile.cluster}/remote-pack-defs" target="profiler-server-${remote.platform.rp.target}" inheritall="false">
|
||||||
|
<property name="cluster" location="${profile.cluster}"/>
|
||||||
|
<property name="dest.dir" location="${java.io.tmpdir}"/>
|
||||||
|
</ant>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="profile-toggle">
|
||||||
|
<property name="profiling.started" value="true"/>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="profile-rp-calibrate-passwd" if="profiling.started">
|
||||||
|
<sshexec host="${remote.platform.host}" port="${remote.platform.port}"
|
||||||
|
username="${remote.platform.user}" password="${remote.platform.password}"
|
||||||
|
trust="true" usepty="true"
|
||||||
|
command="export JAVA_HOME=${remote.platform.home.dir}; [ -f ~/.nbprofiler/machinedata.jdk${remote.platform.java.spec.ver} ] && echo "Calibration data exists: skipping calibration" || /bin/sh ${remote.dist.dir}/remotepack/bin/calibrate.sh"/>
|
||||||
|
<scp file="${remote.platform.user}:${remote.platform.password}@${remote.platform.host}:~/.nbprofiler/machinedata.jdk${remote.platform.java.spec.ver}"
|
||||||
|
localTofile="${user.home}/.nbprofiler/machinedata.jdk${remote.platform.java.spec.ver}.${remote.platform.host}.new" trust="true"/>
|
||||||
|
<antcall target="profile-clean-rp"/>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="profile-rp-calibrate-key" if="profiling.started">
|
||||||
|
<fail unless="remote.platform.keyfile">Must set remote.platform.keyfile</fail>
|
||||||
|
<sshexec host="${remote.platform.host}" port="${remote.platform.port}"
|
||||||
|
username="${remote.platform.user}" keyfile="${remote.platform.keyfile}"
|
||||||
|
passphrase="${remote.platform.passphrase}" trust="true" usepty="true"
|
||||||
|
command="export JAVA_HOME=${remote.platform.home.dir}; [ -f ~/.nbprofiler/machinedata.jdk${remote.platform.java.spec.ver} ] && echo "Calibration data exists: skipping calibration" || /bin/sh ${remote.dist.dir}/remotepack/bin/calibrate.sh"/>
|
||||||
|
<scp file="${remote.platform.user}:${remote.platform.password}@${remote.platform.host}:~/.nbprofiler/machinedata.jdk${remote.platform.java.spec.ver}"
|
||||||
|
localTofile="${user.home}/.nbprofiler/machinedata.jdk${remote.platform.java.spec.ver}.${remote.platform.host}.new" trust="true"
|
||||||
|
keyfile="${remote.platform.keyfile}" passphrase="${remote.platform.passphrase}"/>
|
||||||
|
<antcall target="profile-clean-rp"/>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="run-remote" depends="init, jar, -init-remote-platform-properties, -copy-to-remote-platform, -run-remote-passwd, -run-remote-key"/>
|
||||||
|
<target name="debug-remote" depends="init, jar, -init-remote-platform-properties, -copy-to-remote-platform, -check-vm-debug, -debug-remote-passwd, -debug-remote-key"/>
|
||||||
|
<target name="profile-remote" depends="init, jar, profile-toggle, -init-remote-platform-properties, profile-rp-unzip, -profile-check" if="profiler.configured">
|
||||||
|
<startprofiler/>
|
||||||
|
<mkdir dir="${user.home}/.nbprofiler"/>
|
||||||
|
<antcall target="-run-remote-passwd"/>
|
||||||
|
<antcall target="-run-remote-key"/>
|
||||||
|
</target>
|
||||||
|
</project>
|
253
nbproject/remote-platform-impl_backup.xml
Normal file
253
nbproject/remote-platform-impl_backup.xml
Normal file
@ -0,0 +1,253 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!--
|
||||||
|
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
|
||||||
|
|
||||||
|
Copyright (c) 2013, 2016 Oracle and/or its affiliates. All rights reserved.
|
||||||
|
|
||||||
|
Oracle and Java are registered trademarks of Oracle and/or its affiliates.
|
||||||
|
Other names may be trademarks of their respective owners.
|
||||||
|
|
||||||
|
The contents of this file are subject to the terms of either the GNU
|
||||||
|
General Public License Version 2 only ("GPL") or the Common
|
||||||
|
Development and Distribution License("CDDL") (collectively, the
|
||||||
|
"License"). You may not use this file except in compliance with the
|
||||||
|
License. You can obtain a copy of the License at
|
||||||
|
http://www.netbeans.org/cddl-gplv2.html
|
||||||
|
or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
|
||||||
|
specific language governing permissions and limitations under the
|
||||||
|
License. When distributing the software, include this License Header
|
||||||
|
Notice in each file and include the License file at
|
||||||
|
nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this
|
||||||
|
particular file as subject to the "Classpath" exception as provided
|
||||||
|
by Oracle in the GPL Version 2 section of the License file that
|
||||||
|
accompanied this code. If applicable, add the following below the
|
||||||
|
License Header, with the fields enclosed by brackets [] replaced by
|
||||||
|
your own identifying information:
|
||||||
|
"Portions Copyrighted [year] [name of copyright owner]"
|
||||||
|
|
||||||
|
If you wish your version of this file to be governed by only the CDDL
|
||||||
|
or only the GPL Version 2, indicate your decision by adding
|
||||||
|
"[Contributor] elects to include this software in this distribution
|
||||||
|
under the [CDDL or GPL Version 2] license." If you do not indicate a
|
||||||
|
single choice of license, a recipient has the option to distribute
|
||||||
|
your version of this file under either the CDDL, the GPL Version 2 or
|
||||||
|
to extend the choice of license to its licensees as provided above.
|
||||||
|
However, if you add GPL Version 2 code and therefore, elected the GPL
|
||||||
|
Version 2 license, then the option applies only if the new code is
|
||||||
|
made subject to such option by the copyright holder.
|
||||||
|
|
||||||
|
Contributor(s):
|
||||||
|
-->
|
||||||
|
|
||||||
|
<project default="default" basedir=".." xmlns:remote="http://www.netbeans.org/ns/j2se-project/remote-platform/1" xmlns:j2seproject1="http://www.netbeans.org/ns/j2se-project/1" xmlns:j2seproject3="http://www.netbeans.org/ns/j2se-project/3">
|
||||||
|
|
||||||
|
<target name="default">
|
||||||
|
<echo message="Default target is not set, you must specify which target you want to run."/>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="-init-remote-platform-properties" depends="init">
|
||||||
|
<fail unless="platform.runtime">Runtime platform (platform.runtime) must be set.</fail>
|
||||||
|
<j2seproject1:property name="remote.platform.home.dir" value="platforms.${platform.runtime}.platform.install.folder"/>
|
||||||
|
<j2seproject1:property name="remote.platform.work.dir" value="platforms.${platform.runtime}.platform.work.folder"/>
|
||||||
|
<j2seproject1:property name="remote.platform.host" value="platforms.${platform.runtime}.platform.host"/>
|
||||||
|
<j2seproject1:property name="remote.platform.port" value="platforms.${platform.runtime}.platform.port"/>
|
||||||
|
<j2seproject1:property name="remote.platform.user" value="platforms.${platform.runtime}.platform.auth.username"/>
|
||||||
|
<j2seproject1:property name="remote.platform.auth" value="platforms.${platform.runtime}.platform.auth.kind"/>
|
||||||
|
<j2seproject1:property name="remote.platform.keyfile" value="platforms.${platform.runtime}.platform.auth.keystore"/>
|
||||||
|
<j2seproject1:property name="remote.platform.exec.decorator" value="platforms.${platform.runtime}.platform.exec.decorator"/>
|
||||||
|
<fail unless="remote.platform.home.dir">Must set remote.platform.home.dir</fail>
|
||||||
|
<fail unless="remote.platform.work.dir">Must set remote.platform.work.dir</fail>
|
||||||
|
<fail unless="remote.platform.host">Must set remote.platform.host</fail>
|
||||||
|
<fail unless="remote.platform.port">Must set remote.platform.port</fail>
|
||||||
|
<fail unless="remote.platform.user">Must set remote.platform.user</fail>
|
||||||
|
<fail unless="remote.platform.auth">Must set remote.platform.auth</fail>
|
||||||
|
<condition property="remote.platform.auth.passwd">
|
||||||
|
<equals arg1="${remote.platform.auth}" arg2="PASSWORD"/>
|
||||||
|
</condition>
|
||||||
|
<condition property="remote.platform.auth.key">
|
||||||
|
<equals arg1="${remote.platform.auth}" arg2="KEY"/>
|
||||||
|
</condition>
|
||||||
|
<basename file="${basedir}" property="remote.project.name"/>
|
||||||
|
<basename file="${dist.dir}" property="remote.dist.dir.name"/>
|
||||||
|
<basename file="${dist.jar}" property="remote.dist.jar.name"/>
|
||||||
|
<property name="remote.project.dir" value="${remote.platform.work.dir}/${remote.project.name}"/>
|
||||||
|
<property name="remote.dist.dir" value="${remote.project.dir}/${remote.dist.dir.name}"/>
|
||||||
|
<property name="remote.dist.jar" value="${remote.dist.dir}/${remote.dist.jar.name}"/>
|
||||||
|
<property name="remote.java.executable" value="${remote.platform.home.dir}/bin/java"/>
|
||||||
|
<scriptdef name="addressport" language="javascript">
|
||||||
|
<attribute name="address" />
|
||||||
|
<attribute name="property" />
|
||||||
|
<![CDATA[
|
||||||
|
var address = attributes.get("address");
|
||||||
|
project.setProperty(attributes.get("property"), address.split(":")[1]);
|
||||||
|
]]>
|
||||||
|
</scriptdef>
|
||||||
|
<condition property="remote.platform.exec.prefix" value="'${remote.platform.exec.decorator}' " else="">
|
||||||
|
<not>
|
||||||
|
<equals arg1="${remote.platform.exec.decorator}" arg2="$${platforms.${platform.runtime}.platform.exec.decorator}"/>
|
||||||
|
</not>
|
||||||
|
</condition>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="-copy-to-remote-platform">
|
||||||
|
<macrodef name="runwithpasswd" uri="http://www.netbeans.org/ns/j2se-project/remote-platform/1">
|
||||||
|
<attribute name="additionaljvmargs" default=""/>
|
||||||
|
<sequential>
|
||||||
|
<sshexec host="${remote.platform.host}" port="${remote.platform.port}" username="${remote.platform.user}" password="${remote.platform.password}" trust="true" command="mkdir -p '${remote.dist.dir}'"/>
|
||||||
|
<scp todir="${remote.platform.user}@${remote.platform.host}:${remote.dist.dir}" port="${remote.platform.port}" password="${remote.platform.password}" trust="true">
|
||||||
|
<fileset dir="${dist.dir}"/>
|
||||||
|
</scp>
|
||||||
|
<antcall target="profile-rp-calibrate-passwd"/>
|
||||||
|
<sshexec host="${remote.platform.host}" port="${remote.platform.port}" username="${remote.platform.user}" password="${remote.platform.password}" trust="true" usepty="true"
|
||||||
|
command="cd '${remote.project.dir}'; ${remote.platform.exec.prefix}'${remote.java.executable}' @{additionaljvmargs} -Dfile.encoding=${runtime.encoding} ${run.jvmargs} ${run.jvmargs.ide} -jar ${remote.dist.jar} ${application.args}"/>
|
||||||
|
</sequential>
|
||||||
|
</macrodef>
|
||||||
|
<macrodef name="runwithkey" uri="http://www.netbeans.org/ns/j2se-project/remote-platform/1">
|
||||||
|
<attribute name="additionaljvmargs" default=""/>
|
||||||
|
<sequential>
|
||||||
|
<fail unless="remote.platform.keyfile">Must set remote.platform.keyfile</fail>
|
||||||
|
<sshexec host="${remote.platform.host}" port="${remote.platform.port}" username="${remote.platform.user}" keyfile="${remote.platform.keyfile}" passphrase="${remote.platform.passphrase}" trust="true" command="mkdir -p '${remote.dist.dir}'"/>
|
||||||
|
<scp todir="${remote.platform.user}@${remote.platform.host}:${remote.dist.dir}" port="${remote.platform.port}" keyfile="${remote.platform.keyfile}" passphrase="${remote.platform.passphrase}" trust="true">
|
||||||
|
<fileset dir="${dist.dir}"/>
|
||||||
|
</scp>
|
||||||
|
<antcall target="profile-rp-calibrate-key"/>
|
||||||
|
<sshexec host="${remote.platform.host}" port="${remote.platform.port}" username="${remote.platform.user}" keyfile="${remote.platform.keyfile}" passphrase="${remote.platform.passphrase}" trust="true" usepty="true"
|
||||||
|
command="cd '${remote.project.dir}'; ${remote.platform.exec.prefix}'${remote.java.executable}' @{additionaljvmargs} -Dfile.encoding=${runtime.encoding} ${run.jvmargs} ${run.jvmargs.ide} -jar ${remote.dist.jar} ${application.args}"/>
|
||||||
|
</sequential>
|
||||||
|
</macrodef>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="-check-vm-debug" depends="init, -init-remote-platform-properties, -copy-to-remote-platform">
|
||||||
|
<j2seproject1:property name="remote.platform.jvm.debug" value="platforms.${platform.runtime}.platform.jvm.debug"/>
|
||||||
|
<condition property="remote.platform.jvm.debug.available" value="true">
|
||||||
|
<or>
|
||||||
|
<contains string="${remote.platform.jvm.debug}" substring="$${platforms."/>
|
||||||
|
<istrue value="${remote.platform.jvm.debug}"/>
|
||||||
|
</or>
|
||||||
|
</condition>
|
||||||
|
<fail unless="remote.platform.jvm.debug.available" message="The Runtime JVM ${remote.platform.host}:${remote.platform.home.dir} does not support debugging."/>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="-ask-password" unless="remote.platform.password" if="remote.platform.auth.passwd">
|
||||||
|
<input message="Password ${remote.platform.user}@${remote.platform.host}:" addproperty="remote.platform.password">
|
||||||
|
<handler type="secure"/>
|
||||||
|
</input>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="-ask-passphrase" unless="remote.platform.passphrase" if="remote.platform.auth.key">
|
||||||
|
<input message="Passphrase ${remote.platform.user}@${remote.platform.host}:" addproperty="remote.platform.passphrase">
|
||||||
|
<handler type="secure"/>
|
||||||
|
</input>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="-run-remote-passwd" depends="init, jar, -init-remote-platform-properties, -copy-to-remote-platform, -ask-password" if="remote.platform.auth.passwd">
|
||||||
|
<remote:runwithpasswd/>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="-debug-remote-passwd" depends="init, jar, -init-remote-platform-properties, -copy-to-remote-platform, -ask-password, -debug-start-debugger" if="remote.platform.auth.passwd">
|
||||||
|
<addressport address="${jpda.address}" property="jpda.port"/>
|
||||||
|
<sshsession host="${remote.platform.host}" port="${remote.platform.port}" username="${remote.platform.user}" password="${remote.platform.password}" trust="true">
|
||||||
|
<remotetunnel lport="${jpda.port}" lhost="localhost" rport="${jpda.port}"/>
|
||||||
|
<sequential>
|
||||||
|
<remote:runwithpasswd additionaljvmargs="${debug-args-line} -Xrunjdwp:transport=${debug-transport},address=${jpda.address}"/>
|
||||||
|
</sequential>
|
||||||
|
</sshsession>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="-run-remote-key" depends="init, jar, -init-remote-platform-properties, -copy-to-remote-platform, -ask-passphrase" if="remote.platform.auth.key">
|
||||||
|
<remote:runwithkey/>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="-debug-remote-key" depends="init, jar, -init-remote-platform-properties, -copy-to-remote-platform, -ask-passphrase, -debug-start-debugger" if="remote.platform.auth.key">
|
||||||
|
<addressport address="${jpda.address}" property="jpda.port"/>
|
||||||
|
<sshsession host="${remote.platform.host}" port="${remote.platform.port}" username="${remote.platform.user}" keyfile="${remote.platform.keyfile}" passphrase="${remote.platform.passphrase}" trust="true">
|
||||||
|
<remotetunnel lport="${jpda.port}" lhost="localhost" rport="${jpda.port}"/>
|
||||||
|
<sequential>
|
||||||
|
<remote:runwithkey additionaljvmargs="${debug-args-line} -Xrunjdwp:transport=${debug-transport},address=${jpda.address}"/>
|
||||||
|
</sequential>
|
||||||
|
</sshsession>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="profile-clean-rp" depends="profile-rp-renew-local-calibration" if="profiling.started">
|
||||||
|
<delete dir="${dist.dir}/remotepack"/>
|
||||||
|
<delete file="${user.home}/.nbprofiler/machinedata.jdk${remote.platform.java.spec.ver}.${remote.platform.host}.new"/>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="profile-rp-renew-local-check">
|
||||||
|
<condition property="profiler.calibration.local-remote.replace">
|
||||||
|
<and>
|
||||||
|
<available file="${user.home}/.nbprofiler/machinedata.jdk${remote.platform.java.spec.ver}.${remote.platform.host}.new" type="file"/>
|
||||||
|
<not>
|
||||||
|
<filesmatch
|
||||||
|
file1="${user.home}/.nbprofiler/machinedata.jdk${remote.platform.java.spec.ver}.${remote.platform.host}"
|
||||||
|
file2="${user.home}/.nbprofiler/machinedata.jdk${remote.platform.java.spec.ver}.${remote.platform.host}.new"/>
|
||||||
|
</not>
|
||||||
|
</and>
|
||||||
|
</condition>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="profile-rp-renew-local-calibration" depends="profile-rp-renew-local-check" if="profiler.calibration.local-remote.replace">
|
||||||
|
<move
|
||||||
|
file="${user.home}/.nbprofiler/machinedata.jdk${remote.platform.java.spec.ver}.${remote.platform.host}.new"
|
||||||
|
tofile="${user.home}/.nbprofiler/machinedata.jdk${remote.platform.java.spec.ver}.${remote.platform.host}"
|
||||||
|
force="true"
|
||||||
|
verbose="true"/>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="profile-rp-unzip" if="profiling.started" depends="profile-rp-create">
|
||||||
|
<unzip src="${java.io.tmpdir}/profiler-server-${remote.platform.rp.filename}.zip" dest="${dist.dir}/remotepack"/>
|
||||||
|
<chmod perm="a+x">
|
||||||
|
<fileset dir="${dist.dir}/remotepack">
|
||||||
|
<include name="**/*.so"/>
|
||||||
|
<include name="**/*.dll"/>
|
||||||
|
<include name="**/*.sh"/>
|
||||||
|
<include name="**/*.jnilib"/>
|
||||||
|
<exclude name="**/*.jar"/>
|
||||||
|
</fileset>
|
||||||
|
</chmod>
|
||||||
|
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="profile-rp-create" if="profiling.started">
|
||||||
|
<property name="profile.cluster" value="${netbeans.home}/../profiler"/>
|
||||||
|
<ant dir="${profile.cluster}/remote-pack-defs" target="profiler-server-${remote.platform.rp.target}" inheritall="false">
|
||||||
|
<property name="cluster" location="${profile.cluster}"/>
|
||||||
|
<property name="dest.dir" location="${java.io.tmpdir}"/>
|
||||||
|
</ant>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="profile-toggle">
|
||||||
|
<property name="profiling.started" value="true"/>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="profile-rp-calibrate-passwd" if="profiling.started">
|
||||||
|
<sshexec host="${remote.platform.host}" port="${remote.platform.port}"
|
||||||
|
username="${remote.platform.user}" password="${remote.platform.password}"
|
||||||
|
trust="true" usepty="true"
|
||||||
|
command="export JAVA_HOME=${remote.platform.home.dir}; [ -f ~/.nbprofiler/machinedata.jdk${remote.platform.java.spec.ver} ] && echo "Calibration data exists: skipping calibration" || /bin/sh ${remote.dist.dir}/remotepack/bin/calibrate.sh"/>
|
||||||
|
<scp file="${remote.platform.user}:${remote.platform.password}@${remote.platform.host}:~/.nbprofiler/machinedata.jdk${remote.platform.java.spec.ver}"
|
||||||
|
localTofile="${user.home}/.nbprofiler/machinedata.jdk${remote.platform.java.spec.ver}.${remote.platform.host}.new" trust="true"/>
|
||||||
|
<antcall target="profile-clean-rp"/>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="profile-rp-calibrate-key" if="profiling.started">
|
||||||
|
<fail unless="remote.platform.keyfile">Must set remote.platform.keyfile</fail>
|
||||||
|
<sshexec host="${remote.platform.host}" port="${remote.platform.port}"
|
||||||
|
username="${remote.platform.user}" keyfile="${remote.platform.keyfile}"
|
||||||
|
passphrase="${remote.platform.passphrase}" trust="true" usepty="true"
|
||||||
|
command="export JAVA_HOME=${remote.platform.home.dir}; [ -f ~/.nbprofiler/machinedata.jdk${remote.platform.java.spec.ver} ] && echo "Calibration data exists: skipping calibration" || /bin/sh ${remote.dist.dir}/remotepack/bin/calibrate.sh"/>
|
||||||
|
<scp file="${remote.platform.user}:${remote.platform.password}@${remote.platform.host}:~/.nbprofiler/machinedata.jdk${remote.platform.java.spec.ver}"
|
||||||
|
localTofile="${user.home}/.nbprofiler/machinedata.jdk${remote.platform.java.spec.ver}.${remote.platform.host}.new" trust="true"
|
||||||
|
keyfile="${remote.platform.keyfile}" passphrase="${remote.platform.passphrase}"/>
|
||||||
|
<antcall target="profile-clean-rp"/>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="run-remote" depends="init, jar, -init-remote-platform-properties, -copy-to-remote-platform, -run-remote-passwd, -run-remote-key"/>
|
||||||
|
<target name="debug-remote" depends="init, jar, -init-remote-platform-properties, -copy-to-remote-platform, -check-vm-debug, -debug-remote-passwd, -debug-remote-key"/>
|
||||||
|
<target name="profile-remote" depends="init, jar, profile-toggle, -init-remote-platform-properties, profile-rp-unzip, -profile-check" if="profiler.configured">
|
||||||
|
<startprofiler/>
|
||||||
|
<mkdir dir="${user.home}/.nbprofiler"/>
|
||||||
|
<antcall target="-run-remote-passwd"/>
|
||||||
|
<antcall target="-run-remote-key"/>
|
||||||
|
</target>
|
||||||
|
</project>
|
237
src/Vista/LogInUser.form
Normal file
237
src/Vista/LogInUser.form
Normal file
@ -0,0 +1,237 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
|
||||||
|
<Form version="1.3" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JFrameFormInfo">
|
||||||
|
<Properties>
|
||||||
|
<Property name="defaultCloseOperation" type="int" value="2"/>
|
||||||
|
<Property name="location" type="java.awt.Point" editor="org.netbeans.beaninfo.editors.PointEditor">
|
||||||
|
<Point value="[0, 0]"/>
|
||||||
|
</Property>
|
||||||
|
<Property name="undecorated" type="boolean" value="true"/>
|
||||||
|
<Property name="resizable" type="boolean" value="false"/>
|
||||||
|
</Properties>
|
||||||
|
<SyntheticProperties>
|
||||||
|
<SyntheticProperty name="formSizePolicy" type="int" value="1"/>
|
||||||
|
<SyntheticProperty name="generateCenter" type="boolean" value="false"/>
|
||||||
|
</SyntheticProperties>
|
||||||
|
<AuxValues>
|
||||||
|
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
|
||||||
|
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
|
||||||
|
<AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
|
||||||
|
<AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
|
||||||
|
<AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
|
||||||
|
<AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
|
||||||
|
<AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
|
||||||
|
<AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
|
||||||
|
<AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
|
||||||
|
<AuxValue name="designerSize" type="java.awt.Dimension" value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,1,86,0,0,1,-118"/>
|
||||||
|
</AuxValues>
|
||||||
|
|
||||||
|
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout">
|
||||||
|
<Property name="useNullLayout" type="boolean" value="false"/>
|
||||||
|
</Layout>
|
||||||
|
<SubComponents>
|
||||||
|
<Component class="javax.swing.JLabel" name="jLabel3">
|
||||||
|
<Properties>
|
||||||
|
<Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
|
||||||
|
<Color blue="ff" green="cc" red="0" type="rgb"/>
|
||||||
|
</Property>
|
||||||
|
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
|
||||||
|
<Font name="SamsungImaginationBold" size="36" style="1"/>
|
||||||
|
</Property>
|
||||||
|
<Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
|
||||||
|
<Color blue="ff" green="ff" red="ff" type="rgb"/>
|
||||||
|
</Property>
|
||||||
|
<Property name="text" type="java.lang.String" value="Bienvenido a Ventas LSR"/>
|
||||||
|
<Property name="focusable" type="boolean" value="false"/>
|
||||||
|
</Properties>
|
||||||
|
<Constraints>
|
||||||
|
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription">
|
||||||
|
<AbsoluteConstraints x="10" y="10" width="370" height="50"/>
|
||||||
|
</Constraint>
|
||||||
|
</Constraints>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JLabel" name="jLabel2">
|
||||||
|
<Properties>
|
||||||
|
<Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
|
||||||
|
<Color blue="ff" green="cc" red="0" type="rgb"/>
|
||||||
|
</Property>
|
||||||
|
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
|
||||||
|
<Font name="SamsungImaginationBold" size="36" style="1"/>
|
||||||
|
</Property>
|
||||||
|
<Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
|
||||||
|
<Color blue="72" green="0" red="1b" type="rgb"/>
|
||||||
|
</Property>
|
||||||
|
<Property name="text" type="java.lang.String" value="Bienvenido a Ventas LSR"/>
|
||||||
|
<Property name="focusable" type="boolean" value="false"/>
|
||||||
|
</Properties>
|
||||||
|
<Constraints>
|
||||||
|
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription">
|
||||||
|
<AbsoluteConstraints x="10" y="10" width="370" height="60"/>
|
||||||
|
</Constraint>
|
||||||
|
</Constraints>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JTextField" name="txtUser">
|
||||||
|
<Properties>
|
||||||
|
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
|
||||||
|
<Font name="Verdana" size="18" style="1"/>
|
||||||
|
</Property>
|
||||||
|
<Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
|
||||||
|
<Color blue="0" green="0" red="e" type="rgb"/>
|
||||||
|
</Property>
|
||||||
|
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
|
||||||
|
<Border info="org.netbeans.modules.form.compat2.border.SoftBevelBorderInfo">
|
||||||
|
<BevelBorder/>
|
||||||
|
</Border>
|
||||||
|
</Property>
|
||||||
|
<Property name="opaque" type="boolean" value="false"/>
|
||||||
|
</Properties>
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="txtUserActionPerformed"/>
|
||||||
|
<EventHandler event="keyPressed" listener="java.awt.event.KeyListener" parameters="java.awt.event.KeyEvent" handler="txtUserKeyPressed"/>
|
||||||
|
</Events>
|
||||||
|
<Constraints>
|
||||||
|
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription">
|
||||||
|
<AbsoluteConstraints x="150" y="130" width="170" height="30"/>
|
||||||
|
</Constraint>
|
||||||
|
</Constraints>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JPasswordField" name="jPass">
|
||||||
|
<Properties>
|
||||||
|
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
|
||||||
|
<Font name="Verdana" size="18" style="1"/>
|
||||||
|
</Property>
|
||||||
|
<Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
|
||||||
|
<Color blue="0" green="0" red="e" type="rgb"/>
|
||||||
|
</Property>
|
||||||
|
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
|
||||||
|
<Border info="org.netbeans.modules.form.compat2.border.SoftBevelBorderInfo">
|
||||||
|
<BevelBorder/>
|
||||||
|
</Border>
|
||||||
|
</Property>
|
||||||
|
<Property name="opaque" type="boolean" value="false"/>
|
||||||
|
</Properties>
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="keyPressed" listener="java.awt.event.KeyListener" parameters="java.awt.event.KeyEvent" handler="jPassKeyPressed"/>
|
||||||
|
</Events>
|
||||||
|
<Constraints>
|
||||||
|
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription">
|
||||||
|
<AbsoluteConstraints x="150" y="210" width="170" height="30"/>
|
||||||
|
</Constraint>
|
||||||
|
</Constraints>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JLabel" name="jLabel4">
|
||||||
|
<Properties>
|
||||||
|
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
|
||||||
|
<Font name="Dialog" size="18" style="1"/>
|
||||||
|
</Property>
|
||||||
|
<Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
|
||||||
|
<Color blue="ff" green="ff" red="ff" type="rgb"/>
|
||||||
|
</Property>
|
||||||
|
<Property name="text" type="java.lang.String" value="Nombre"/>
|
||||||
|
</Properties>
|
||||||
|
<Constraints>
|
||||||
|
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription">
|
||||||
|
<AbsoluteConstraints x="150" y="100" width="110" height="20"/>
|
||||||
|
</Constraint>
|
||||||
|
</Constraints>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JLabel" name="jLabel5">
|
||||||
|
<Properties>
|
||||||
|
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
|
||||||
|
<Font name="Dialog" size="18" style="1"/>
|
||||||
|
</Property>
|
||||||
|
<Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
|
||||||
|
<Color blue="ff" green="ff" red="ff" type="rgb"/>
|
||||||
|
</Property>
|
||||||
|
<Property name="text" type="java.lang.String" value="Contraseña"/>
|
||||||
|
</Properties>
|
||||||
|
<Constraints>
|
||||||
|
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription">
|
||||||
|
<AbsoluteConstraints x="150" y="180" width="100" height="20"/>
|
||||||
|
</Constraint>
|
||||||
|
</Constraints>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JButton" name="btnEnt">
|
||||||
|
<Properties>
|
||||||
|
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
|
||||||
|
<Font name="Dialog" size="14" style="1"/>
|
||||||
|
</Property>
|
||||||
|
<Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
|
||||||
|
<Color blue="ff" green="ff" red="ff" type="rgb"/>
|
||||||
|
</Property>
|
||||||
|
<Property name="text" type="java.lang.String" value="Entrar"/>
|
||||||
|
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
|
||||||
|
<Border info="org.netbeans.modules.form.compat2.border.SoftBevelBorderInfo">
|
||||||
|
<BevelBorder/>
|
||||||
|
</Border>
|
||||||
|
</Property>
|
||||||
|
<Property name="contentAreaFilled" type="boolean" value="false"/>
|
||||||
|
</Properties>
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnEntActionPerformed"/>
|
||||||
|
</Events>
|
||||||
|
<Constraints>
|
||||||
|
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription">
|
||||||
|
<AbsoluteConstraints x="250" y="290" width="70" height="30"/>
|
||||||
|
</Constraint>
|
||||||
|
</Constraints>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JButton" name="btnSalir">
|
||||||
|
<Properties>
|
||||||
|
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
|
||||||
|
<Font name="Dialog" size="14" style="1"/>
|
||||||
|
</Property>
|
||||||
|
<Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
|
||||||
|
<Color blue="ff" green="ff" red="ff" type="rgb"/>
|
||||||
|
</Property>
|
||||||
|
<Property name="text" type="java.lang.String" value="Salir"/>
|
||||||
|
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
|
||||||
|
<Border info="org.netbeans.modules.form.compat2.border.SoftBevelBorderInfo">
|
||||||
|
<BevelBorder/>
|
||||||
|
</Border>
|
||||||
|
</Property>
|
||||||
|
<Property name="contentAreaFilled" type="boolean" value="false"/>
|
||||||
|
<Property name="maximumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||||
|
<Dimension value="[49, 25]"/>
|
||||||
|
</Property>
|
||||||
|
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||||
|
<Dimension value="[49, 25]"/>
|
||||||
|
</Property>
|
||||||
|
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||||
|
<Dimension value="[49, 25]"/>
|
||||||
|
</Property>
|
||||||
|
</Properties>
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnSalirActionPerformed"/>
|
||||||
|
</Events>
|
||||||
|
<Constraints>
|
||||||
|
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription">
|
||||||
|
<AbsoluteConstraints x="150" y="290" width="70" height="30"/>
|
||||||
|
</Constraint>
|
||||||
|
</Constraints>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JLabel" name="jLabel6">
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="jLabel6MouseClicked"/>
|
||||||
|
</Events>
|
||||||
|
<Constraints>
|
||||||
|
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription">
|
||||||
|
<AbsoluteConstraints x="10" y="60" width="20" height="30"/>
|
||||||
|
</Constraint>
|
||||||
|
</Constraints>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JLabel" name="jLabel1">
|
||||||
|
<Properties>
|
||||||
|
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
|
||||||
|
<Image iconType="3" name="/imagenes/braingridcircuitboard.png"/>
|
||||||
|
</Property>
|
||||||
|
<Property name="text" type="java.lang.String" value="jLabel1"/>
|
||||||
|
</Properties>
|
||||||
|
<Constraints>
|
||||||
|
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription">
|
||||||
|
<AbsoluteConstraints x="0" y="0" width="398" height="350"/>
|
||||||
|
</Constraint>
|
||||||
|
</Constraints>
|
||||||
|
</Component>
|
||||||
|
</SubComponents>
|
||||||
|
</Form>
|
219
src/Vista/LogInUser.java
Normal file
219
src/Vista/LogInUser.java
Normal file
@ -0,0 +1,219 @@
|
|||||||
|
package Vista; /** @author jp.av.dev@gmail.com */
|
||||||
|
|
||||||
|
import java.awt.event.KeyEvent;
|
||||||
|
import javax.swing.JOptionPane;
|
||||||
|
|
||||||
|
|
||||||
|
public class LogInUser extends javax.swing.JFrame {
|
||||||
|
String usuario;
|
||||||
|
String pass;
|
||||||
|
|
||||||
|
public LogInUser() {
|
||||||
|
initComponents();
|
||||||
|
this.usuario ="admin";
|
||||||
|
this.pass ="admin";
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAdmin() {
|
||||||
|
return usuario;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAdmin(String usuario) {
|
||||||
|
this.usuario = usuario;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPass() {
|
||||||
|
return pass;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPass(String pass) {
|
||||||
|
this.pass = pass;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
|
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
|
||||||
|
private void initComponents() {
|
||||||
|
|
||||||
|
jLabel3 = new javax.swing.JLabel();
|
||||||
|
jLabel2 = new javax.swing.JLabel();
|
||||||
|
txtUser = new javax.swing.JTextField();
|
||||||
|
jPass = new javax.swing.JPasswordField();
|
||||||
|
jLabel4 = new javax.swing.JLabel();
|
||||||
|
jLabel5 = new javax.swing.JLabel();
|
||||||
|
btnEnt = new javax.swing.JButton();
|
||||||
|
btnSalir = new javax.swing.JButton();
|
||||||
|
jLabel6 = new javax.swing.JLabel();
|
||||||
|
jLabel1 = new javax.swing.JLabel();
|
||||||
|
|
||||||
|
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
|
||||||
|
setLocation(new java.awt.Point(0, 0));
|
||||||
|
setUndecorated(true);
|
||||||
|
setResizable(false);
|
||||||
|
getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());
|
||||||
|
|
||||||
|
jLabel3.setBackground(new java.awt.Color(0, 204, 255));
|
||||||
|
jLabel3.setFont(new java.awt.Font("SamsungImaginationBold", 1, 36)); // NOI18N
|
||||||
|
jLabel3.setForeground(new java.awt.Color(255, 255, 255));
|
||||||
|
jLabel3.setText("Bienvenido a Ventas LSR");
|
||||||
|
jLabel3.setFocusable(false);
|
||||||
|
getContentPane().add(jLabel3, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 10, 370, 50));
|
||||||
|
|
||||||
|
jLabel2.setBackground(new java.awt.Color(0, 204, 255));
|
||||||
|
jLabel2.setFont(new java.awt.Font("SamsungImaginationBold", 1, 36)); // NOI18N
|
||||||
|
jLabel2.setForeground(new java.awt.Color(27, 0, 114));
|
||||||
|
jLabel2.setText("Bienvenido a Ventas LSR");
|
||||||
|
jLabel2.setFocusable(false);
|
||||||
|
getContentPane().add(jLabel2, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 10, 370, 60));
|
||||||
|
|
||||||
|
txtUser.setFont(new java.awt.Font("Verdana", 1, 18)); // NOI18N
|
||||||
|
txtUser.setForeground(new java.awt.Color(14, 0, 0));
|
||||||
|
txtUser.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.RAISED));
|
||||||
|
txtUser.setOpaque(false);
|
||||||
|
txtUser.addActionListener(new java.awt.event.ActionListener() {
|
||||||
|
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||||
|
txtUserActionPerformed(evt);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
txtUser.addKeyListener(new java.awt.event.KeyAdapter() {
|
||||||
|
public void keyPressed(java.awt.event.KeyEvent evt) {
|
||||||
|
txtUserKeyPressed(evt);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
getContentPane().add(txtUser, new org.netbeans.lib.awtextra.AbsoluteConstraints(150, 130, 170, 30));
|
||||||
|
|
||||||
|
jPass.setFont(new java.awt.Font("Verdana", 1, 18)); // NOI18N
|
||||||
|
jPass.setForeground(new java.awt.Color(14, 0, 0));
|
||||||
|
jPass.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.RAISED));
|
||||||
|
jPass.setOpaque(false);
|
||||||
|
jPass.addKeyListener(new java.awt.event.KeyAdapter() {
|
||||||
|
public void keyPressed(java.awt.event.KeyEvent evt) {
|
||||||
|
jPassKeyPressed(evt);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
getContentPane().add(jPass, new org.netbeans.lib.awtextra.AbsoluteConstraints(150, 210, 170, 30));
|
||||||
|
|
||||||
|
jLabel4.setFont(new java.awt.Font("Dialog", 1, 18)); // NOI18N
|
||||||
|
jLabel4.setForeground(new java.awt.Color(255, 255, 255));
|
||||||
|
jLabel4.setText("Nombre");
|
||||||
|
getContentPane().add(jLabel4, new org.netbeans.lib.awtextra.AbsoluteConstraints(150, 100, 110, 20));
|
||||||
|
|
||||||
|
jLabel5.setFont(new java.awt.Font("Dialog", 1, 18)); // NOI18N
|
||||||
|
jLabel5.setForeground(new java.awt.Color(255, 255, 255));
|
||||||
|
jLabel5.setText("Contraseña");
|
||||||
|
getContentPane().add(jLabel5, new org.netbeans.lib.awtextra.AbsoluteConstraints(150, 180, 100, 20));
|
||||||
|
|
||||||
|
btnEnt.setFont(new java.awt.Font("Dialog", 1, 14)); // NOI18N
|
||||||
|
btnEnt.setForeground(new java.awt.Color(255, 255, 255));
|
||||||
|
btnEnt.setText("Entrar");
|
||||||
|
btnEnt.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.RAISED));
|
||||||
|
btnEnt.setContentAreaFilled(false);
|
||||||
|
btnEnt.addActionListener(new java.awt.event.ActionListener() {
|
||||||
|
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||||
|
btnEntActionPerformed(evt);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
getContentPane().add(btnEnt, new org.netbeans.lib.awtextra.AbsoluteConstraints(250, 290, 70, 30));
|
||||||
|
|
||||||
|
btnSalir.setFont(new java.awt.Font("Dialog", 1, 14)); // NOI18N
|
||||||
|
btnSalir.setForeground(new java.awt.Color(255, 255, 255));
|
||||||
|
btnSalir.setText("Salir");
|
||||||
|
btnSalir.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.RAISED));
|
||||||
|
btnSalir.setContentAreaFilled(false);
|
||||||
|
btnSalir.setMaximumSize(new java.awt.Dimension(49, 25));
|
||||||
|
btnSalir.setMinimumSize(new java.awt.Dimension(49, 25));
|
||||||
|
btnSalir.setPreferredSize(new java.awt.Dimension(49, 25));
|
||||||
|
btnSalir.addActionListener(new java.awt.event.ActionListener() {
|
||||||
|
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||||
|
btnSalirActionPerformed(evt);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
getContentPane().add(btnSalir, new org.netbeans.lib.awtextra.AbsoluteConstraints(150, 290, 70, 30));
|
||||||
|
|
||||||
|
jLabel6.addMouseListener(new java.awt.event.MouseAdapter() {
|
||||||
|
public void mouseClicked(java.awt.event.MouseEvent evt) {
|
||||||
|
jLabel6MouseClicked(evt);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
getContentPane().add(jLabel6, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 60, 20, 30));
|
||||||
|
|
||||||
|
jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagenes/braingridcircuitboard.png"))); // NOI18N
|
||||||
|
jLabel1.setText("jLabel1");
|
||||||
|
getContentPane().add(jLabel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, 398, 350));
|
||||||
|
|
||||||
|
pack();
|
||||||
|
}// </editor-fold>//GEN-END:initComponents
|
||||||
|
|
||||||
|
private void txtUserActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtUserActionPerformed
|
||||||
|
|
||||||
|
}//GEN-LAST:event_txtUserActionPerformed
|
||||||
|
|
||||||
|
private void btnSalirActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSalirActionPerformed
|
||||||
|
System.exit(0);
|
||||||
|
}//GEN-LAST:event_btnSalirActionPerformed
|
||||||
|
|
||||||
|
private void btnEntActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnEntActionPerformed
|
||||||
|
if (validarUsuario()) {
|
||||||
|
MenuPrincipal mP = new MenuPrincipal(usuario);
|
||||||
|
mP.setVisible(true);
|
||||||
|
mP.setLocationRelativeTo(null);
|
||||||
|
this.dispose();
|
||||||
|
} else {
|
||||||
|
JOptionPane.showMessageDialog(this, "Favor verificar datos", "Log-In",JOptionPane.WARNING_MESSAGE);
|
||||||
|
txtUser.setText("");
|
||||||
|
jPass.setText("");
|
||||||
|
}
|
||||||
|
}//GEN-LAST:event_btnEntActionPerformed
|
||||||
|
|
||||||
|
private void jLabel6MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabel6MouseClicked
|
||||||
|
if (evt.getClickCount() == 2) {
|
||||||
|
MenuPrincipal mP = new MenuPrincipal(usuario);
|
||||||
|
mP.setVisible(true);
|
||||||
|
mP.setLocationRelativeTo(null);
|
||||||
|
this.dispose();
|
||||||
|
}
|
||||||
|
}//GEN-LAST:event_jLabel6MouseClicked
|
||||||
|
|
||||||
|
private void jPassKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jPassKeyPressed
|
||||||
|
if (evt.getKeyCode() == KeyEvent.VK_ENTER) {
|
||||||
|
if (validarUsuario()) {
|
||||||
|
MenuPrincipal mP = new MenuPrincipal(usuario);
|
||||||
|
mP.setVisible(true);
|
||||||
|
mP.setLocationRelativeTo(null);
|
||||||
|
this.dispose();
|
||||||
|
} else {
|
||||||
|
JOptionPane.showMessageDialog(this, "Favor verificar datos", "Log-In",JOptionPane.WARNING_MESSAGE);
|
||||||
|
jPass.setText("");
|
||||||
|
txtUser.setText("");
|
||||||
|
txtUser.requestFocus();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}//GEN-LAST:event_jPassKeyPressed
|
||||||
|
|
||||||
|
private void txtUserKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtUserKeyPressed
|
||||||
|
if(evt.getKeyCode() == KeyEvent.VK_ENTER) jPass.requestFocus();
|
||||||
|
}//GEN-LAST:event_txtUserKeyPressed
|
||||||
|
|
||||||
|
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||||
|
private javax.swing.JButton btnEnt;
|
||||||
|
private javax.swing.JButton btnSalir;
|
||||||
|
private javax.swing.JLabel jLabel1;
|
||||||
|
private javax.swing.JLabel jLabel2;
|
||||||
|
private javax.swing.JLabel jLabel3;
|
||||||
|
private javax.swing.JLabel jLabel4;
|
||||||
|
private javax.swing.JLabel jLabel5;
|
||||||
|
private javax.swing.JLabel jLabel6;
|
||||||
|
private javax.swing.JPasswordField jPass;
|
||||||
|
private javax.swing.JTextField txtUser;
|
||||||
|
// End of variables declaration//GEN-END:variables
|
||||||
|
|
||||||
|
private boolean validarUsuario() {
|
||||||
|
String password = "";
|
||||||
|
char[] passw = jPass.getPassword();
|
||||||
|
for (int i=0; i<passw.length; i++) {
|
||||||
|
password = password + passw[i];
|
||||||
|
}
|
||||||
|
return txtUser.getText().equalsIgnoreCase(usuario) && (password.equals(pass));
|
||||||
|
}
|
||||||
|
}
|
266
src/Vista/MantenedorProductos.form
Normal file
266
src/Vista/MantenedorProductos.form
Normal file
@ -0,0 +1,266 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
|
||||||
|
<Form version="1.6" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JFrameFormInfo">
|
||||||
|
<Properties>
|
||||||
|
<Property name="defaultCloseOperation" type="int" value="2"/>
|
||||||
|
<Property name="resizable" type="boolean" value="false"/>
|
||||||
|
</Properties>
|
||||||
|
<SyntheticProperties>
|
||||||
|
<SyntheticProperty name="formSizePolicy" type="int" value="1"/>
|
||||||
|
<SyntheticProperty name="generateCenter" type="boolean" value="false"/>
|
||||||
|
</SyntheticProperties>
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="windowStateChanged" listener="java.awt.event.WindowStateListener" parameters="java.awt.event.WindowEvent" handler="formWindowStateChanged"/>
|
||||||
|
</Events>
|
||||||
|
<AuxValues>
|
||||||
|
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
|
||||||
|
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
|
||||||
|
<AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
|
||||||
|
<AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
|
||||||
|
<AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
|
||||||
|
<AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
|
||||||
|
<AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
|
||||||
|
<AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
|
||||||
|
<AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
|
||||||
|
</AuxValues>
|
||||||
|
|
||||||
|
<Layout>
|
||||||
|
<DimensionLayout dim="0">
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Group type="102" alignment="0" attributes="0">
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Group type="102" alignment="0" attributes="0">
|
||||||
|
<Component id="jScrollPane1" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<Component id="jSeparator1" alignment="0" max="32767" attributes="0"/>
|
||||||
|
<Group type="102" alignment="1" attributes="0">
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Group type="102" attributes="0">
|
||||||
|
<Component id="jLabel5" max="32767" attributes="0"/>
|
||||||
|
<EmptySpace min="-2" pref="34" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<Group type="102" attributes="0">
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Group type="102" attributes="0">
|
||||||
|
<Component id="jLabel1" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace min="-2" pref="50" max="-2" attributes="0"/>
|
||||||
|
<Component id="jLabel6" min="-2" pref="50" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace min="-2" pref="37" max="-2" attributes="0"/>
|
||||||
|
<Component id="jLabel7" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<Group type="102" attributes="0">
|
||||||
|
<Component id="txtPrec" min="-2" pref="68" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace type="separate" max="-2" attributes="0"/>
|
||||||
|
<Component id="txtStock" min="-2" pref="69" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace type="separate" max="-2" attributes="0"/>
|
||||||
|
<Component id="txtStockMin" min="-2" pref="70" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<Group type="102" alignment="0" attributes="0">
|
||||||
|
<Group type="103" groupAlignment="0" max="-2" attributes="0">
|
||||||
|
<Group type="102" attributes="0">
|
||||||
|
<Component id="jLabel4" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace min="-2" pref="48" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<Group type="102" attributes="0">
|
||||||
|
<Component id="txtCod" max="32767" attributes="0"/>
|
||||||
|
<EmptySpace min="-2" pref="19" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
</Group>
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Component id="jLabel3" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="txtDesc" alignment="0" min="-2" pref="156" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
</Group>
|
||||||
|
</Group>
|
||||||
|
<EmptySpace max="32767" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
</Group>
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Group type="102" alignment="0" attributes="0">
|
||||||
|
<Component id="btnCrear" min="-2" pref="85" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace type="separate" max="-2" attributes="0"/>
|
||||||
|
<Component id="btnEdit" min="-2" pref="85" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<Group type="102" alignment="0" attributes="0">
|
||||||
|
<Component id="btnConsulta" min="-2" pref="85" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace type="separate" max="-2" attributes="0"/>
|
||||||
|
<Component id="btnElmininar" min="-2" pref="85" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
</Group>
|
||||||
|
</Group>
|
||||||
|
</Group>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
</Group>
|
||||||
|
</DimensionLayout>
|
||||||
|
<DimensionLayout dim="1">
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Group type="102" alignment="0" attributes="0">
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Group type="102" alignment="0" attributes="0">
|
||||||
|
<Component id="jLabel5" min="-2" pref="24" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace min="-2" pref="14" max="-2" attributes="0"/>
|
||||||
|
<Group type="103" groupAlignment="3" attributes="0">
|
||||||
|
<Component id="jLabel3" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="jLabel4" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Group type="103" groupAlignment="3" attributes="0">
|
||||||
|
<Component id="txtDesc" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="txtCod" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Group type="103" groupAlignment="3" attributes="0">
|
||||||
|
<Component id="jLabel1" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="jLabel6" alignment="3" min="-2" pref="15" max="-2" attributes="0"/>
|
||||||
|
<Component id="jLabel7" alignment="3" min="-2" pref="15" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Group type="103" groupAlignment="3" attributes="0">
|
||||||
|
<Component id="txtStockMin" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="txtStock" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="txtPrec" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
</Group>
|
||||||
|
<Group type="102" alignment="0" attributes="0">
|
||||||
|
<Group type="103" groupAlignment="3" attributes="0">
|
||||||
|
<Component id="btnElmininar" alignment="3" min="-2" pref="54" max="-2" attributes="0"/>
|
||||||
|
<Component id="btnConsulta" alignment="3" min="-2" pref="55" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Component id="btnCrear" alignment="0" min="-2" pref="55" max="-2" attributes="0"/>
|
||||||
|
<Component id="btnEdit" min="-2" pref="54" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
</Group>
|
||||||
|
</Group>
|
||||||
|
<EmptySpace max="32767" attributes="0"/>
|
||||||
|
<Component id="jSeparator1" min="-2" pref="2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace type="separate" max="-2" attributes="0"/>
|
||||||
|
<Component id="jScrollPane1" min="-2" pref="163" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
</Group>
|
||||||
|
</DimensionLayout>
|
||||||
|
</Layout>
|
||||||
|
<SubComponents>
|
||||||
|
<Component class="javax.swing.JTextField" name="txtCod">
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="txtCodActionPerformed"/>
|
||||||
|
<EventHandler event="keyPressed" listener="java.awt.event.KeyListener" parameters="java.awt.event.KeyEvent" handler="txtCodKeyPressed"/>
|
||||||
|
</Events>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JTextField" name="txtPrec">
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="txtPrecActionPerformed"/>
|
||||||
|
</Events>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JTextField" name="txtDesc">
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="txtDescActionPerformed"/>
|
||||||
|
</Events>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JLabel" name="jLabel1">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" value="Precio :"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JLabel" name="jLabel3">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" value="Descripción :"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JLabel" name="jLabel4">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" value="Código :"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JLabel" name="jLabel5">
|
||||||
|
<Properties>
|
||||||
|
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
|
||||||
|
<Font name="MS UI Gothic" size="18" style="0"/>
|
||||||
|
</Property>
|
||||||
|
<Property name="text" type="java.lang.String" value="Mantenedor Productos"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JButton" name="btnCrear">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" value="Crear"/>
|
||||||
|
</Properties>
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnCrearActionPerformed"/>
|
||||||
|
</Events>
|
||||||
|
</Component>
|
||||||
|
<Container class="javax.swing.JScrollPane" name="jScrollPane1">
|
||||||
|
<AuxValues>
|
||||||
|
<AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
|
||||||
|
</AuxValues>
|
||||||
|
|
||||||
|
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
|
||||||
|
<SubComponents>
|
||||||
|
<Component class="javax.swing.JTable" name="tablaProductos">
|
||||||
|
<Properties>
|
||||||
|
<Property name="model" type="javax.swing.table.TableModel" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
|
||||||
|
<Connection code="modeloProductos" type="code"/>
|
||||||
|
</Property>
|
||||||
|
<Property name="columnModel" type="javax.swing.table.TableColumnModel" editor="org.netbeans.modules.form.editors2.TableColumnModelEditor">
|
||||||
|
<TableColumnModel selectionModel="0"/>
|
||||||
|
</Property>
|
||||||
|
<Property name="tableHeader" type="javax.swing.table.JTableHeader" editor="org.netbeans.modules.form.editors2.JTableHeaderEditor">
|
||||||
|
<TableHeader reorderingAllowed="true" resizingAllowed="true"/>
|
||||||
|
</Property>
|
||||||
|
</Properties>
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="tablaProductosMouseClicked"/>
|
||||||
|
</Events>
|
||||||
|
</Component>
|
||||||
|
</SubComponents>
|
||||||
|
</Container>
|
||||||
|
<Component class="javax.swing.JButton" name="btnConsulta">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" value="Consulta"/>
|
||||||
|
</Properties>
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnConsultaActionPerformed"/>
|
||||||
|
</Events>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JButton" name="btnEdit">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" value="Editar"/>
|
||||||
|
</Properties>
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnEditActionPerformed"/>
|
||||||
|
</Events>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JButton" name="btnElmininar">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" value="Eliminar"/>
|
||||||
|
</Properties>
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnElmininarActionPerformed"/>
|
||||||
|
</Events>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JLabel" name="jLabel6">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" value="Stock :"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JTextField" name="txtStockMin">
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="txtStockMinActionPerformed"/>
|
||||||
|
</Events>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JLabel" name="jLabel7">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" value="Stock Mínimo :"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JTextField" name="txtStock">
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JSeparator" name="jSeparator1">
|
||||||
|
</Component>
|
||||||
|
</SubComponents>
|
||||||
|
</Form>
|
477
src/Vista/MantenedorProductos.java
Normal file
477
src/Vista/MantenedorProductos.java
Normal file
@ -0,0 +1,477 @@
|
|||||||
|
package Vista; /** @author jp.av.dev@gmail.com */
|
||||||
|
|
||||||
|
import java.awt.event.KeyEvent;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import javax.swing.JOptionPane;
|
||||||
|
import static javax.swing.SwingConstants.CENTER;
|
||||||
|
import javax.swing.table.DefaultTableCellRenderer;
|
||||||
|
import javax.swing.table.DefaultTableModel;
|
||||||
|
import static jdk.nashorn.internal.objects.NativeString.trim;
|
||||||
|
import modelo.ListaProductos;
|
||||||
|
import modelo.Producto;
|
||||||
|
|
||||||
|
|
||||||
|
public class MantenedorProductos extends javax.swing.JFrame {
|
||||||
|
private static ListaProductos lp;
|
||||||
|
private final ArrayList<Producto> productos; //Declarada final por recomendación de NetBeans
|
||||||
|
private DefaultTableModel modeloProductos;
|
||||||
|
private DefaultTableCellRenderer centrar;
|
||||||
|
|
||||||
|
public MantenedorProductos() {
|
||||||
|
MantenedorProductos.lp = new ListaProductos();
|
||||||
|
this.productos = new ArrayList<>();
|
||||||
|
cargarModeloTabla();
|
||||||
|
initComponents();
|
||||||
|
limpiar();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static ListaProductos getLp() {
|
||||||
|
return lp;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void FormatoTabla() {
|
||||||
|
centrar = new DefaultTableCellRenderer();
|
||||||
|
centrar.setHorizontalAlignment(CENTER);
|
||||||
|
tablaProductos.getColumnModel().getColumn(0).setPreferredWidth(30);
|
||||||
|
tablaProductos.getColumnModel().getColumn(0).setCellRenderer(centrar);
|
||||||
|
tablaProductos.getColumnModel().getColumn(1).setPreferredWidth(120);
|
||||||
|
tablaProductos.getColumnModel().getColumn(2).setPreferredWidth(40);
|
||||||
|
tablaProductos.getColumnModel().getColumn(3).setPreferredWidth(40);
|
||||||
|
tablaProductos.getColumnModel().getColumn(3).setCellRenderer(centrar);
|
||||||
|
tablaProductos.getColumnModel().getColumn(4).setPreferredWidth(50);
|
||||||
|
tablaProductos.getColumnModel().getColumn(4).setCellRenderer(centrar);
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
|
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
|
||||||
|
private void initComponents() {
|
||||||
|
|
||||||
|
txtCod = new javax.swing.JTextField();
|
||||||
|
txtPrec = new javax.swing.JTextField();
|
||||||
|
txtDesc = new javax.swing.JTextField();
|
||||||
|
jLabel1 = new javax.swing.JLabel();
|
||||||
|
jLabel3 = new javax.swing.JLabel();
|
||||||
|
jLabel4 = new javax.swing.JLabel();
|
||||||
|
jLabel5 = new javax.swing.JLabel();
|
||||||
|
btnCrear = new javax.swing.JButton();
|
||||||
|
jScrollPane1 = new javax.swing.JScrollPane();
|
||||||
|
tablaProductos = new javax.swing.JTable();
|
||||||
|
btnConsulta = new javax.swing.JButton();
|
||||||
|
btnEdit = new javax.swing.JButton();
|
||||||
|
btnElmininar = new javax.swing.JButton();
|
||||||
|
jLabel6 = new javax.swing.JLabel();
|
||||||
|
txtStockMin = new javax.swing.JTextField();
|
||||||
|
jLabel7 = new javax.swing.JLabel();
|
||||||
|
txtStock = new javax.swing.JTextField();
|
||||||
|
jSeparator1 = new javax.swing.JSeparator();
|
||||||
|
|
||||||
|
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
|
||||||
|
setResizable(false);
|
||||||
|
addWindowStateListener(new java.awt.event.WindowStateListener() {
|
||||||
|
public void windowStateChanged(java.awt.event.WindowEvent evt) {
|
||||||
|
formWindowStateChanged(evt);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
txtCod.addActionListener(new java.awt.event.ActionListener() {
|
||||||
|
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||||
|
txtCodActionPerformed(evt);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
txtCod.addKeyListener(new java.awt.event.KeyAdapter() {
|
||||||
|
public void keyPressed(java.awt.event.KeyEvent evt) {
|
||||||
|
txtCodKeyPressed(evt);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
txtPrec.addActionListener(new java.awt.event.ActionListener() {
|
||||||
|
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||||
|
txtPrecActionPerformed(evt);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
txtDesc.addActionListener(new java.awt.event.ActionListener() {
|
||||||
|
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||||
|
txtDescActionPerformed(evt);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
jLabel1.setText("Precio :");
|
||||||
|
|
||||||
|
jLabel3.setText("Descripción :");
|
||||||
|
|
||||||
|
jLabel4.setText("Código :");
|
||||||
|
|
||||||
|
jLabel5.setFont(new java.awt.Font("MS UI Gothic", 0, 18)); // NOI18N
|
||||||
|
jLabel5.setText("Mantenedor Productos");
|
||||||
|
|
||||||
|
btnCrear.setText("Crear");
|
||||||
|
btnCrear.addActionListener(new java.awt.event.ActionListener() {
|
||||||
|
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||||
|
btnCrearActionPerformed(evt);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
tablaProductos.setModel(modeloProductos);
|
||||||
|
tablaProductos.addMouseListener(new java.awt.event.MouseAdapter() {
|
||||||
|
public void mouseClicked(java.awt.event.MouseEvent evt) {
|
||||||
|
tablaProductosMouseClicked(evt);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
jScrollPane1.setViewportView(tablaProductos);
|
||||||
|
|
||||||
|
btnConsulta.setText("Consulta");
|
||||||
|
btnConsulta.addActionListener(new java.awt.event.ActionListener() {
|
||||||
|
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||||
|
btnConsultaActionPerformed(evt);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
btnEdit.setText("Editar");
|
||||||
|
btnEdit.addActionListener(new java.awt.event.ActionListener() {
|
||||||
|
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||||
|
btnEditActionPerformed(evt);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
btnElmininar.setText("Eliminar");
|
||||||
|
btnElmininar.addActionListener(new java.awt.event.ActionListener() {
|
||||||
|
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||||
|
btnElmininarActionPerformed(evt);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
jLabel6.setText("Stock :");
|
||||||
|
|
||||||
|
txtStockMin.addActionListener(new java.awt.event.ActionListener() {
|
||||||
|
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||||
|
txtStockMinActionPerformed(evt);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
jLabel7.setText("Stock Mínimo :");
|
||||||
|
|
||||||
|
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
|
||||||
|
getContentPane().setLayout(layout);
|
||||||
|
layout.setHorizontalGroup(
|
||||||
|
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
|
.addGroup(layout.createSequentialGroup()
|
||||||
|
.addContainerGap()
|
||||||
|
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
|
.addGroup(layout.createSequentialGroup()
|
||||||
|
.addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||||
|
.addGap(0, 0, Short.MAX_VALUE))
|
||||||
|
.addComponent(jSeparator1)
|
||||||
|
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
|
||||||
|
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
|
.addGroup(layout.createSequentialGroup()
|
||||||
|
.addComponent(jLabel5, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||||
|
.addGap(34, 34, 34))
|
||||||
|
.addGroup(layout.createSequentialGroup()
|
||||||
|
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
|
.addGroup(layout.createSequentialGroup()
|
||||||
|
.addComponent(jLabel1)
|
||||||
|
.addGap(50, 50, 50)
|
||||||
|
.addComponent(jLabel6, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||||
|
.addGap(37, 37, 37)
|
||||||
|
.addComponent(jLabel7))
|
||||||
|
.addGroup(layout.createSequentialGroup()
|
||||||
|
.addComponent(txtPrec, javax.swing.GroupLayout.PREFERRED_SIZE, 68, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||||
|
.addGap(18, 18, 18)
|
||||||
|
.addComponent(txtStock, javax.swing.GroupLayout.PREFERRED_SIZE, 69, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||||
|
.addGap(18, 18, 18)
|
||||||
|
.addComponent(txtStockMin, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||||
|
.addGroup(layout.createSequentialGroup()
|
||||||
|
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
|
||||||
|
.addGroup(layout.createSequentialGroup()
|
||||||
|
.addComponent(jLabel4)
|
||||||
|
.addGap(48, 48, 48))
|
||||||
|
.addGroup(layout.createSequentialGroup()
|
||||||
|
.addComponent(txtCod)
|
||||||
|
.addGap(19, 19, 19)))
|
||||||
|
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
|
.addComponent(jLabel3)
|
||||||
|
.addComponent(txtDesc, javax.swing.GroupLayout.PREFERRED_SIZE, 156, javax.swing.GroupLayout.PREFERRED_SIZE))))
|
||||||
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
|
||||||
|
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
|
.addGroup(layout.createSequentialGroup()
|
||||||
|
.addComponent(btnCrear, javax.swing.GroupLayout.PREFERRED_SIZE, 85, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||||
|
.addGap(18, 18, 18)
|
||||||
|
.addComponent(btnEdit, javax.swing.GroupLayout.PREFERRED_SIZE, 85, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||||
|
.addGroup(layout.createSequentialGroup()
|
||||||
|
.addComponent(btnConsulta, javax.swing.GroupLayout.PREFERRED_SIZE, 85, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||||
|
.addGap(18, 18, 18)
|
||||||
|
.addComponent(btnElmininar, javax.swing.GroupLayout.PREFERRED_SIZE, 85, javax.swing.GroupLayout.PREFERRED_SIZE)))))
|
||||||
|
.addContainerGap())
|
||||||
|
);
|
||||||
|
layout.setVerticalGroup(
|
||||||
|
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
|
.addGroup(layout.createSequentialGroup()
|
||||||
|
.addContainerGap()
|
||||||
|
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
|
.addGroup(layout.createSequentialGroup()
|
||||||
|
.addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||||
|
.addGap(14, 14, 14)
|
||||||
|
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||||
|
.addComponent(jLabel3)
|
||||||
|
.addComponent(jLabel4))
|
||||||
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||||
|
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||||
|
.addComponent(txtDesc, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||||
|
.addComponent(txtCod, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||||
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||||
|
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||||
|
.addComponent(jLabel1)
|
||||||
|
.addComponent(jLabel6, javax.swing.GroupLayout.PREFERRED_SIZE, 15, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||||
|
.addComponent(jLabel7, javax.swing.GroupLayout.PREFERRED_SIZE, 15, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||||
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||||
|
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||||
|
.addComponent(txtStockMin, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||||
|
.addComponent(txtStock, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||||
|
.addComponent(txtPrec, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
|
||||||
|
.addGroup(layout.createSequentialGroup()
|
||||||
|
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||||
|
.addComponent(btnElmininar, javax.swing.GroupLayout.PREFERRED_SIZE, 54, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||||
|
.addComponent(btnConsulta, javax.swing.GroupLayout.PREFERRED_SIZE, 55, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||||
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||||
|
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
|
.addComponent(btnCrear, javax.swing.GroupLayout.PREFERRED_SIZE, 55, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||||
|
.addComponent(btnEdit, javax.swing.GroupLayout.PREFERRED_SIZE, 54, javax.swing.GroupLayout.PREFERRED_SIZE))))
|
||||||
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||||
|
.addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 2, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||||
|
.addGap(18, 18, 18)
|
||||||
|
.addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 163, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||||
|
.addContainerGap())
|
||||||
|
);
|
||||||
|
|
||||||
|
pack();
|
||||||
|
}// </editor-fold>//GEN-END:initComponents
|
||||||
|
|
||||||
|
private void txtCodActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtCodActionPerformed
|
||||||
|
}//GEN-LAST:event_txtCodActionPerformed
|
||||||
|
|
||||||
|
private void txtPrecActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtPrecActionPerformed
|
||||||
|
}//GEN-LAST:event_txtPrecActionPerformed
|
||||||
|
|
||||||
|
private void txtDescActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtDescActionPerformed
|
||||||
|
}//GEN-LAST:event_txtDescActionPerformed
|
||||||
|
|
||||||
|
private void btnCrearActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCrearActionPerformed
|
||||||
|
if (validarTxt()) {
|
||||||
|
crearProducto();
|
||||||
|
} else {
|
||||||
|
JOptionPane.showMessageDialog(this, "Debes llenar todos los campos", "Advertencia", JOptionPane.WARNING_MESSAGE);
|
||||||
|
}
|
||||||
|
}//GEN-LAST:event_btnCrearActionPerformed
|
||||||
|
|
||||||
|
private void btnConsultaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnConsultaActionPerformed
|
||||||
|
String consulta = JOptionPane.showInputDialog(this, "Ingresar Código de Producto :", "Buscar", JOptionPane.QUESTION_MESSAGE);
|
||||||
|
consultaPrecio(consulta);
|
||||||
|
}//GEN-LAST:event_btnConsultaActionPerformed
|
||||||
|
|
||||||
|
private void txtStockMinActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtStockMinActionPerformed
|
||||||
|
}//GEN-LAST:event_txtStockMinActionPerformed
|
||||||
|
|
||||||
|
private void txtCodKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtCodKeyPressed
|
||||||
|
if(evt.getKeyCode() == KeyEvent.VK_ENTER) {
|
||||||
|
String consulta = txtCod.getText();
|
||||||
|
consultaPrecio(consulta);
|
||||||
|
}
|
||||||
|
}//GEN-LAST:event_txtCodKeyPressed
|
||||||
|
|
||||||
|
private void btnElmininarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnElmininarActionPerformed
|
||||||
|
if (!txtCod.getText().equals("")){
|
||||||
|
borrarProducto(txtCod.getText());
|
||||||
|
} else {
|
||||||
|
JOptionPane.showMessageDialog(this, "Debes ingresar un código de producto válido", "Error al eliminar", JOptionPane.ERROR_MESSAGE);
|
||||||
|
}
|
||||||
|
}//GEN-LAST:event_btnElmininarActionPerformed
|
||||||
|
|
||||||
|
private void btnEditActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnEditActionPerformed
|
||||||
|
if (validarTxt()) {
|
||||||
|
editProd();
|
||||||
|
} else {
|
||||||
|
JOptionPane.showMessageDialog(this, "Debes llenar todos los campos", "Advertencia", JOptionPane.WARNING_MESSAGE);
|
||||||
|
}
|
||||||
|
}//GEN-LAST:event_btnEditActionPerformed
|
||||||
|
|
||||||
|
private void tablaProductosMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tablaProductosMouseClicked
|
||||||
|
ClickTabla(evt);
|
||||||
|
}//GEN-LAST:event_tablaProductosMouseClicked
|
||||||
|
|
||||||
|
private void formWindowStateChanged(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowStateChanged
|
||||||
|
System.out.println(evt.toString());
|
||||||
|
}//GEN-LAST:event_formWindowStateChanged
|
||||||
|
|
||||||
|
private void ClickTabla(java.awt.event.MouseEvent evt) {
|
||||||
|
int row = tablaProductos.rowAtPoint(evt.getPoint());
|
||||||
|
if (row >= 0) {
|
||||||
|
txtCod.setText(tablaProductos.getValueAt(row,0).toString());
|
||||||
|
txtDesc.setText(tablaProductos.getValueAt(row,1).toString());
|
||||||
|
txtPrec.setText(tablaProductos.getValueAt(row,2).toString());
|
||||||
|
txtStock.setText(tablaProductos.getValueAt(row,3).toString());
|
||||||
|
txtStockMin.setText(tablaProductos.getValueAt(row,4).toString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean validarTxt() {
|
||||||
|
return ( (!txtCod.getText().equals("")) && (!txtPrec.getText().equals("")) && (!txtDesc.getText().equals(""))
|
||||||
|
&& (!txtStockMin.getText().equals("")) && (!txtStock.getText().equals("")) );
|
||||||
|
}
|
||||||
|
|
||||||
|
private void limpiar(){
|
||||||
|
txtCod.setText(""); txtStock.setText(""); txtStockMin.setText("");
|
||||||
|
txtPrec.setText(""); txtDesc.setText("");
|
||||||
|
cargaTablaModelo(lp.getLp());
|
||||||
|
tablaProductos.setModel(modeloProductos);
|
||||||
|
txtCod.requestFocus();
|
||||||
|
FormatoTabla();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void consultaPrecio(String consulta) {
|
||||||
|
if (!"".equals(consulta)) {
|
||||||
|
if (!"".equals(lp.buscarProducto(consulta).getCodigo())) {
|
||||||
|
Producto prodTemp = lp.buscarProducto(consulta);
|
||||||
|
txtCod.setText(prodTemp.getCodigo());
|
||||||
|
txtDesc.setText(prodTemp.getDescripcion());
|
||||||
|
txtPrec.setText(Integer.toString(prodTemp.getPrecio()));
|
||||||
|
txtStock.setText(Integer.toString(prodTemp.getStock()));
|
||||||
|
txtStockMin.setText(Integer.toString(prodTemp.getStockMin()));
|
||||||
|
} else {
|
||||||
|
JOptionPane.showMessageDialog(rootPane, "Producto no encontrado, completar datos para Crear");
|
||||||
|
limpiar();
|
||||||
|
txtCod.setText(consulta);
|
||||||
|
txtDesc.requestFocus();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
JOptionPane.showMessageDialog(this, "Debes ingresar un código", "Advertencia", JOptionPane.WARNING_MESSAGE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void cargaTablaModelo(ArrayList<Producto> productos) {
|
||||||
|
String columnas[] = new String[]{"Código", "Descripción", "Precio", "Stock Actual", "Stock Mínimo"};
|
||||||
|
modeloProductos = new DefaultTableModel(null, columnas);
|
||||||
|
for (int cont = 0;cont < productos.size(); cont++) {
|
||||||
|
Object datos[]=new Object[5];
|
||||||
|
datos[0]=productos.get(cont).getCodigo();
|
||||||
|
datos[1]=productos.get(cont).getDescripcion();
|
||||||
|
datos[2]="$ "+productos.get(cont).getPrecio()+ ".-";
|
||||||
|
datos[3]=productos.get(cont).getStock();
|
||||||
|
datos[4]=productos.get(cont).getStockMin();
|
||||||
|
modeloProductos.addRow(datos);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void crearProducto() {
|
||||||
|
if ( validarPrecio() && validarStock() ) {
|
||||||
|
if ( "".equals(lp.buscarProducto(txtCod.getText()).getCodigo())) {
|
||||||
|
try {
|
||||||
|
Producto prodTemp = new Producto(txtCod.getText(), txtDesc.getText(), Integer.parseInt(txtPrec.getText()), Integer.parseInt(txtStock.getText()), Integer.parseInt(txtStockMin.getText()));
|
||||||
|
lp.crearProducto(txtCod.getText(), txtDesc.getText(), Integer.parseInt(txtPrec.getText()), Integer.parseInt(txtStock.getText()), Integer.parseInt(txtStockMin.getText()));
|
||||||
|
JOptionPane.showMessageDialog(this, prodTemp.toString(), "Producto Creado", 1 );
|
||||||
|
cargaTablaModelo(lp.getLp());
|
||||||
|
limpiar();
|
||||||
|
} catch (NumberFormatException e) {
|
||||||
|
JOptionPane.showMessageDialog(this, "Favor verificar datos ingresados", "Error!", JOptionPane.ERROR_MESSAGE);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
JOptionPane.showMessageDialog(this, "El código ingresado ya existe", "Advertencia", JOptionPane.WARNING_MESSAGE);
|
||||||
|
limpiar();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
JOptionPane.showMessageDialog(this, "Favor verificar datos ingresados", "Error!", JOptionPane.ERROR_MESSAGE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void cargarModeloTabla() {
|
||||||
|
productos.add(new Producto("0001", "Perejíl sin hojas", 65000, 630, 400));
|
||||||
|
productos.add(new Producto("0002", "Volantín de Cuero", 50, 3, 5));
|
||||||
|
productos.add(new Producto("0003", "Hoyo del queque", 780000, 16, 10));
|
||||||
|
productos.add(new Producto("0004", "Tarro con mas duraznos", 1200, 478, 300));
|
||||||
|
lp.setLp(productos);
|
||||||
|
cargaTablaModelo(lp.getLp());
|
||||||
|
}
|
||||||
|
|
||||||
|
private void borrarProducto(String cod) {
|
||||||
|
if (lp.eliminarProducto(cod)) {
|
||||||
|
JOptionPane.showMessageDialog(rootPane, "Producto eliminado!", "Borrar Producto", JOptionPane.INFORMATION_MESSAGE);
|
||||||
|
limpiar();
|
||||||
|
} else {
|
||||||
|
JOptionPane.showMessageDialog(rootPane, "Código ingresado no existe", "Advertencia", JOptionPane.WARNING_MESSAGE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void editProd() {
|
||||||
|
if (validarPrecio() && validarStock()) {
|
||||||
|
try {
|
||||||
|
Producto editar = new Producto(txtCod.getText(), txtDesc.getText(), Integer.parseInt(txtPrec.getText()), Integer.parseInt(txtStock.getText()), Integer.parseInt(txtStockMin.getText()));
|
||||||
|
if (lp.editarProducto(editar)) {
|
||||||
|
JOptionPane.showMessageDialog(this, "Producto editado", "Editar Producto", JOptionPane.INFORMATION_MESSAGE);
|
||||||
|
limpiar();
|
||||||
|
} else {
|
||||||
|
JOptionPane.showMessageDialog(this, "Producto no existe", "Advertencia", JOptionPane.WARNING_MESSAGE);
|
||||||
|
}
|
||||||
|
} catch ( NumberFormatException e) {
|
||||||
|
JOptionPane.showMessageDialog(this, "Favor verificar datos ingresados", "Error!", JOptionPane.ERROR_MESSAGE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean validarPrecio() {
|
||||||
|
boolean intValid = false;
|
||||||
|
try {
|
||||||
|
Integer.parseInt(txtPrec.getText());
|
||||||
|
intValid = true;
|
||||||
|
return intValid;
|
||||||
|
} catch (NumberFormatException e){
|
||||||
|
try {
|
||||||
|
if (txtPrec.getText().charAt(1) == ' ') {
|
||||||
|
txtPrec.setText(txtPrec.getText().replace("$ ", ""));
|
||||||
|
txtPrec.setText(txtPrec.getText().replace(".-", ""));
|
||||||
|
txtPrec.setText(trim(txtPrec.getText()));
|
||||||
|
intValid = true;
|
||||||
|
return intValid;
|
||||||
|
}
|
||||||
|
} catch (Exception e2) {
|
||||||
|
JOptionPane.showMessageDialog(this, "Formato Precio no admitido.\nIngresar solo números", "Advertencia", JOptionPane.WARNING_MESSAGE);
|
||||||
|
return intValid;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
JOptionPane.showMessageDialog(this, "Formato Precio no admitido.\nIngresar solo números", "Advertencia", JOptionPane.WARNING_MESSAGE);
|
||||||
|
return intValid;
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean validarStock() {
|
||||||
|
boolean intStockValid = false;
|
||||||
|
try {
|
||||||
|
Integer.parseInt(txtStock.getText());
|
||||||
|
Integer.parseInt(txtStockMin.getText());
|
||||||
|
intStockValid = true;
|
||||||
|
return intStockValid;
|
||||||
|
} catch (NumberFormatException e) {
|
||||||
|
JOptionPane.showMessageDialog(this, "Formato de Stock o Stock Mínimo no admitidos.\nIngresar solo números", "Advertencia", JOptionPane.WARNING_MESSAGE);
|
||||||
|
return intStockValid;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||||
|
private javax.swing.JButton btnConsulta;
|
||||||
|
private javax.swing.JButton btnCrear;
|
||||||
|
private javax.swing.JButton btnEdit;
|
||||||
|
private javax.swing.JButton btnElmininar;
|
||||||
|
private javax.swing.JLabel jLabel1;
|
||||||
|
private javax.swing.JLabel jLabel3;
|
||||||
|
private javax.swing.JLabel jLabel4;
|
||||||
|
private javax.swing.JLabel jLabel5;
|
||||||
|
private javax.swing.JLabel jLabel6;
|
||||||
|
private javax.swing.JLabel jLabel7;
|
||||||
|
private javax.swing.JScrollPane jScrollPane1;
|
||||||
|
private javax.swing.JSeparator jSeparator1;
|
||||||
|
private javax.swing.JTable tablaProductos;
|
||||||
|
private javax.swing.JTextField txtCod;
|
||||||
|
private javax.swing.JTextField txtDesc;
|
||||||
|
private javax.swing.JTextField txtPrec;
|
||||||
|
private javax.swing.JTextField txtStock;
|
||||||
|
private javax.swing.JTextField txtStockMin;
|
||||||
|
// End of variables declaration//GEN-END:variables
|
||||||
|
}
|
53
src/Vista/MantenedorUsuarios.form
Normal file
53
src/Vista/MantenedorUsuarios.form
Normal file
@ -0,0 +1,53 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
|
||||||
|
<Form version="1.3" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JFrameFormInfo">
|
||||||
|
<Properties>
|
||||||
|
<Property name="defaultCloseOperation" type="int" value="2"/>
|
||||||
|
</Properties>
|
||||||
|
<SyntheticProperties>
|
||||||
|
<SyntheticProperty name="formSizePolicy" type="int" value="1"/>
|
||||||
|
<SyntheticProperty name="generateCenter" type="boolean" value="false"/>
|
||||||
|
</SyntheticProperties>
|
||||||
|
<AuxValues>
|
||||||
|
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
|
||||||
|
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
|
||||||
|
<AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
|
||||||
|
<AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
|
||||||
|
<AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
|
||||||
|
<AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
|
||||||
|
<AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
|
||||||
|
<AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
|
||||||
|
<AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
|
||||||
|
</AuxValues>
|
||||||
|
|
||||||
|
<Layout>
|
||||||
|
<DimensionLayout dim="0">
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Group type="102" alignment="0" attributes="0">
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Component id="jLabel1" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace pref="230" max="32767" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
</Group>
|
||||||
|
</DimensionLayout>
|
||||||
|
<DimensionLayout dim="1">
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Group type="102" alignment="0" attributes="0">
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Component id="jLabel1" min="-2" pref="26" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace pref="308" max="32767" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
</Group>
|
||||||
|
</DimensionLayout>
|
||||||
|
</Layout>
|
||||||
|
<SubComponents>
|
||||||
|
<Component class="javax.swing.JLabel" name="jLabel1">
|
||||||
|
<Properties>
|
||||||
|
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
|
||||||
|
<Font name="MS UI Gothic" size="18" style="0"/>
|
||||||
|
</Property>
|
||||||
|
<Property name="text" type="java.lang.String" value="Mantenedor Usuarios"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
</SubComponents>
|
||||||
|
</Form>
|
69
src/Vista/MantenedorUsuarios.java
Normal file
69
src/Vista/MantenedorUsuarios.java
Normal file
@ -0,0 +1,69 @@
|
|||||||
|
package Vista; /** @author jp.av.dev@gmail.com */
|
||||||
|
|
||||||
|
|
||||||
|
public class MantenedorUsuarios extends javax.swing.JFrame {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates new form MantenedorProducto
|
||||||
|
*/
|
||||||
|
public MantenedorUsuarios() {
|
||||||
|
initComponents();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
|
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
|
||||||
|
private void initComponents() {
|
||||||
|
|
||||||
|
jLabel1 = new javax.swing.JLabel();
|
||||||
|
|
||||||
|
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
|
||||||
|
|
||||||
|
jLabel1.setFont(new java.awt.Font("MS UI Gothic", 0, 18)); // NOI18N
|
||||||
|
jLabel1.setText("Mantenedor Usuarios");
|
||||||
|
|
||||||
|
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
|
||||||
|
getContentPane().setLayout(layout);
|
||||||
|
layout.setHorizontalGroup(
|
||||||
|
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
|
.addGroup(layout.createSequentialGroup()
|
||||||
|
.addContainerGap()
|
||||||
|
.addComponent(jLabel1)
|
||||||
|
.addContainerGap(230, Short.MAX_VALUE))
|
||||||
|
);
|
||||||
|
layout.setVerticalGroup(
|
||||||
|
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
|
.addGroup(layout.createSequentialGroup()
|
||||||
|
.addContainerGap()
|
||||||
|
.addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||||
|
.addContainerGap(308, Short.MAX_VALUE))
|
||||||
|
);
|
||||||
|
|
||||||
|
pack();
|
||||||
|
}// </editor-fold>//GEN-END:initComponents
|
||||||
|
|
||||||
|
/**
|
||||||
|
public static void main(String args[]) {
|
||||||
|
try {
|
||||||
|
for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
|
||||||
|
if ("Nimbus".equals(info.getName())) {
|
||||||
|
javax.swing.UIManager.setLookAndFeel(info.getClassName());
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (ClassNotFoundException | InstantiationException | IllegalAccessException | javax.swing.UnsupportedLookAndFeelException ex) {
|
||||||
|
java.util.logging.Logger.getLogger(MantenedorProducto.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
|
||||||
|
}
|
||||||
|
|
||||||
|
//Create and display the form
|
||||||
|
java.awt.EventQueue.invokeLater(new Runnable() {
|
||||||
|
public void run() {
|
||||||
|
new MantenedorProducto().setVisible(true);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||||
|
private javax.swing.JLabel jLabel1;
|
||||||
|
// End of variables declaration//GEN-END:variables
|
||||||
|
}
|
420
src/Vista/MenuPrincipal.form
Normal file
420
src/Vista/MenuPrincipal.form
Normal file
@ -0,0 +1,420 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
|
||||||
|
<Form version="1.5" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JFrameFormInfo">
|
||||||
|
<NonVisualComponents>
|
||||||
|
<Container class="javax.swing.JMenuBar" name="jMenuBar2">
|
||||||
|
|
||||||
|
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout">
|
||||||
|
<Property name="useNullLayout" type="boolean" value="true"/>
|
||||||
|
</Layout>
|
||||||
|
<SubComponents>
|
||||||
|
<Menu class="javax.swing.JMenu" name="jMenu3">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" value="File"/>
|
||||||
|
</Properties>
|
||||||
|
</Menu>
|
||||||
|
<Menu class="javax.swing.JMenu" name="jMenu4">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" value="Edit"/>
|
||||||
|
</Properties>
|
||||||
|
</Menu>
|
||||||
|
</SubComponents>
|
||||||
|
</Container>
|
||||||
|
<Component class="javax.swing.JMenuItem" name="jMenuItem2">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" value="jMenuItem2"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Container class="javax.swing.JScrollPane" name="jScrollPane1">
|
||||||
|
<AuxValues>
|
||||||
|
<AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
|
||||||
|
</AuxValues>
|
||||||
|
|
||||||
|
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
|
||||||
|
<SubComponents>
|
||||||
|
<Component class="javax.swing.JTable" name="jTable1">
|
||||||
|
<Properties>
|
||||||
|
<Property name="model" type="javax.swing.table.TableModel" editor="org.netbeans.modules.form.editors2.TableModelEditor">
|
||||||
|
<Table columnCount="4" rowCount="4">
|
||||||
|
<Column editable="true" title="Title 1" type="java.lang.Object"/>
|
||||||
|
<Column editable="true" title="Title 2" type="java.lang.Object"/>
|
||||||
|
<Column editable="true" title="Title 3" type="java.lang.Object"/>
|
||||||
|
<Column editable="true" title="Title 4" type="java.lang.Object"/>
|
||||||
|
</Table>
|
||||||
|
</Property>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
</SubComponents>
|
||||||
|
</Container>
|
||||||
|
<Menu class="javax.swing.JMenuBar" name="jMenuBar1">
|
||||||
|
<SubComponents>
|
||||||
|
<Menu class="javax.swing.JMenu" name="jMenu1">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" value="Mantenedores"/>
|
||||||
|
</Properties>
|
||||||
|
<SubComponents>
|
||||||
|
<MenuItem class="javax.swing.JMenuItem" name="menuProd">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" value="de Productos"/>
|
||||||
|
</Properties>
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="menuProdActionPerformed"/>
|
||||||
|
</Events>
|
||||||
|
</MenuItem>
|
||||||
|
<MenuItem class="javax.swing.JMenuItem" name="menuUser">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" value="de Usuarios"/>
|
||||||
|
</Properties>
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="menuUserActionPerformed"/>
|
||||||
|
</Events>
|
||||||
|
</MenuItem>
|
||||||
|
</SubComponents>
|
||||||
|
</Menu>
|
||||||
|
<Menu class="javax.swing.JMenu" name="jMenu2">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" value="Editor"/>
|
||||||
|
</Properties>
|
||||||
|
<SubComponents>
|
||||||
|
<MenuItem class="javax.swing.JMenuItem" name="jMenuItem1">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" value="Anular Venta"/>
|
||||||
|
</Properties>
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jMenuItem1ActionPerformed"/>
|
||||||
|
</Events>
|
||||||
|
</MenuItem>
|
||||||
|
</SubComponents>
|
||||||
|
</Menu>
|
||||||
|
<Menu class="javax.swing.JMenu" name="jMenu5">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" value="Ayuda"/>
|
||||||
|
</Properties>
|
||||||
|
<SubComponents>
|
||||||
|
<MenuItem class="javax.swing.JMenuItem" name="acercaDe">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" value="Acerca de"/>
|
||||||
|
</Properties>
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="acercaDeActionPerformed"/>
|
||||||
|
</Events>
|
||||||
|
</MenuItem>
|
||||||
|
</SubComponents>
|
||||||
|
</Menu>
|
||||||
|
</SubComponents>
|
||||||
|
</Menu>
|
||||||
|
</NonVisualComponents>
|
||||||
|
<Properties>
|
||||||
|
<Property name="defaultCloseOperation" type="int" value="3"/>
|
||||||
|
<Property name="title" type="java.lang.String" value="Sistema de Ventas L.S.R. v 1.0"/>
|
||||||
|
<Property name="resizable" type="boolean" value="false"/>
|
||||||
|
</Properties>
|
||||||
|
<SyntheticProperties>
|
||||||
|
<SyntheticProperty name="menuBar" type="java.lang.String" value="jMenuBar1"/>
|
||||||
|
<SyntheticProperty name="formSizePolicy" type="int" value="1"/>
|
||||||
|
<SyntheticProperty name="generateCenter" type="boolean" value="false"/>
|
||||||
|
</SyntheticProperties>
|
||||||
|
<AuxValues>
|
||||||
|
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
|
||||||
|
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
|
||||||
|
<AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
|
||||||
|
<AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
|
||||||
|
<AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
|
||||||
|
<AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
|
||||||
|
<AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
|
||||||
|
<AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
|
||||||
|
<AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
|
||||||
|
</AuxValues>
|
||||||
|
|
||||||
|
<Layout>
|
||||||
|
<DimensionLayout dim="0">
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Group type="102" attributes="0">
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Group type="102" attributes="0">
|
||||||
|
<EmptySpace min="-2" pref="9" max="-2" attributes="0"/>
|
||||||
|
<Component id="jLabel1" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace min="-2" pref="3" max="-2" attributes="0"/>
|
||||||
|
<Component id="txtProd" min="-2" pref="80" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace type="unrelated" max="-2" attributes="0"/>
|
||||||
|
<Component id="jLabel6" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Component id="jspCant" min="-2" pref="60" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace pref="56" max="32767" attributes="0"/>
|
||||||
|
<Component id="btnQuitar" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<Group type="102" alignment="1" attributes="0">
|
||||||
|
<Component id="btnCalc" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace max="32767" attributes="0"/>
|
||||||
|
<Component id="btnConsulta" min="-2" pref="100" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace type="separate" max="-2" attributes="0"/>
|
||||||
|
<Component id="btnNvaVenta" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace type="separate" max="-2" attributes="0"/>
|
||||||
|
<Component id="btnBrrVnta" min="-2" pref="100" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<Component id="jScrollPane2" alignment="0" pref="485" max="32767" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Component id="txtTotal" alignment="1" max="32767" attributes="0"/>
|
||||||
|
<Group type="102" attributes="0">
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Component id="jLabel3" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="jLabel2" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="jLabel4" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<EmptySpace min="0" pref="66" max="32767" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<Component id="jfEfectivo" max="32767" attributes="0"/>
|
||||||
|
<Component id="txtVuelto" alignment="0" max="32767" attributes="0"/>
|
||||||
|
<Component id="btnGnrVenta" alignment="1" max="32767" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<EmptySpace min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
</Group>
|
||||||
|
</DimensionLayout>
|
||||||
|
<DimensionLayout dim="1">
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Group type="102" alignment="0" attributes="0">
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Group type="103" groupAlignment="0" max="-2" attributes="0">
|
||||||
|
<Group type="103" groupAlignment="3" attributes="0">
|
||||||
|
<Component id="txtProd" alignment="3" min="-2" pref="30" max="-2" attributes="0"/>
|
||||||
|
<Component id="jLabel1" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="jLabel6" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<Component id="jspCant" alignment="0" max="32767" attributes="0"/>
|
||||||
|
<Component id="btnQuitar" alignment="0" max="32767" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<EmptySpace pref="15" max="32767" attributes="0"/>
|
||||||
|
<Group type="103" groupAlignment="0" max="-2" attributes="0">
|
||||||
|
<Group type="102" attributes="0">
|
||||||
|
<Component id="jScrollPane2" min="-2" pref="200" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<Group type="102" alignment="1" attributes="0">
|
||||||
|
<Component id="jLabel2" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Component id="txtTotal" min="-2" pref="30" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace type="unrelated" max="-2" attributes="0"/>
|
||||||
|
<Component id="jLabel3" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Component id="jfEfectivo" min="-2" pref="30" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace type="separate" max="-2" attributes="0"/>
|
||||||
|
<Component id="jLabel4" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Component id="txtVuelto" min="-2" pref="30" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace min="-2" pref="23" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
</Group>
|
||||||
|
<Group type="103" groupAlignment="0" max="-2" attributes="0">
|
||||||
|
<Group type="103" groupAlignment="3" attributes="0">
|
||||||
|
<Component id="btnGnrVenta" alignment="3" min="-2" pref="50" max="-2" attributes="0"/>
|
||||||
|
<Component id="btnBrrVnta" alignment="3" min="-2" pref="50" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<Component id="btnCalc" max="32767" attributes="0"/>
|
||||||
|
<Component id="btnConsulta" alignment="0" max="32767" attributes="0"/>
|
||||||
|
<Component id="btnNvaVenta" alignment="0" max="32767" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
</Group>
|
||||||
|
</DimensionLayout>
|
||||||
|
</Layout>
|
||||||
|
<SubComponents>
|
||||||
|
<Component class="javax.swing.JTextField" name="txtProd">
|
||||||
|
<Properties>
|
||||||
|
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
|
||||||
|
<Font name="Dialog" size="14" style="0"/>
|
||||||
|
</Property>
|
||||||
|
<Property name="enabled" type="boolean" value="false"/>
|
||||||
|
</Properties>
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="keyPressed" listener="java.awt.event.KeyListener" parameters="java.awt.event.KeyEvent" handler="txtProdKeyPressed"/>
|
||||||
|
</Events>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JTextField" name="txtTotal">
|
||||||
|
<Properties>
|
||||||
|
<Property name="editable" type="boolean" value="false"/>
|
||||||
|
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
|
||||||
|
<Font name="Dialog" size="14" style="1"/>
|
||||||
|
</Property>
|
||||||
|
<Property name="horizontalAlignment" type="int" value="0"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JTextField" name="txtVuelto">
|
||||||
|
<Properties>
|
||||||
|
<Property name="editable" type="boolean" value="false"/>
|
||||||
|
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
|
||||||
|
<Font name="Dialog" size="14" style="0"/>
|
||||||
|
</Property>
|
||||||
|
<Property name="horizontalAlignment" type="int" value="0"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Container class="javax.swing.JScrollPane" name="jScrollPane2">
|
||||||
|
<AuxValues>
|
||||||
|
<AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
|
||||||
|
</AuxValues>
|
||||||
|
|
||||||
|
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
|
||||||
|
<SubComponents>
|
||||||
|
<Component class="javax.swing.JTable" name="tbVenta">
|
||||||
|
<Properties>
|
||||||
|
<Property name="columnModel" type="javax.swing.table.TableColumnModel" editor="org.netbeans.modules.form.editors2.TableColumnModelEditor">
|
||||||
|
<TableColumnModel selectionModel="0">
|
||||||
|
<Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true">
|
||||||
|
<Title/>
|
||||||
|
<Editor/>
|
||||||
|
<Renderer/>
|
||||||
|
</Column>
|
||||||
|
<Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true">
|
||||||
|
<Title/>
|
||||||
|
<Editor/>
|
||||||
|
<Renderer/>
|
||||||
|
</Column>
|
||||||
|
<Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true">
|
||||||
|
<Title/>
|
||||||
|
<Editor/>
|
||||||
|
<Renderer/>
|
||||||
|
</Column>
|
||||||
|
<Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true">
|
||||||
|
<Title/>
|
||||||
|
<Editor/>
|
||||||
|
<Renderer/>
|
||||||
|
</Column>
|
||||||
|
<Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true">
|
||||||
|
<Title/>
|
||||||
|
<Editor/>
|
||||||
|
<Renderer/>
|
||||||
|
</Column>
|
||||||
|
</TableColumnModel>
|
||||||
|
</Property>
|
||||||
|
<Property name="tableHeader" type="javax.swing.table.JTableHeader" editor="org.netbeans.modules.form.editors2.JTableHeaderEditor">
|
||||||
|
<TableHeader reorderingAllowed="false" resizingAllowed="true"/>
|
||||||
|
</Property>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
</SubComponents>
|
||||||
|
</Container>
|
||||||
|
<Component class="javax.swing.JButton" name="btnQuitar">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" value="Quitar Producto"/>
|
||||||
|
<Property name="enabled" type="boolean" value="false"/>
|
||||||
|
</Properties>
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnQuitarActionPerformed"/>
|
||||||
|
</Events>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JButton" name="btnGnrVenta">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" value="Generar Venta"/>
|
||||||
|
<Property name="enabled" type="boolean" value="false"/>
|
||||||
|
</Properties>
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnGnrVentaActionPerformed"/>
|
||||||
|
</Events>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JButton" name="btnBrrVnta">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" value="Desechar"/>
|
||||||
|
<Property name="enabled" type="boolean" value="false"/>
|
||||||
|
</Properties>
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnBrrVntaActionPerformed"/>
|
||||||
|
</Events>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JLabel" name="jLabel1">
|
||||||
|
<Properties>
|
||||||
|
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
|
||||||
|
<Font name="Dialog" size="14" style="0"/>
|
||||||
|
</Property>
|
||||||
|
<Property name="text" type="java.lang.String" value="Producto : "/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JLabel" name="jLabel2">
|
||||||
|
<Properties>
|
||||||
|
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
|
||||||
|
<Font name="Dialog" size="14" style="1"/>
|
||||||
|
</Property>
|
||||||
|
<Property name="text" type="java.lang.String" value="TOTAL :"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JLabel" name="jLabel3">
|
||||||
|
<Properties>
|
||||||
|
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
|
||||||
|
<Font name="Dialog" size="12" style="0"/>
|
||||||
|
</Property>
|
||||||
|
<Property name="text" type="java.lang.String" value="Efectivo :"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JLabel" name="jLabel4">
|
||||||
|
<Properties>
|
||||||
|
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
|
||||||
|
<Font name="Dialog" size="12" style="0"/>
|
||||||
|
</Property>
|
||||||
|
<Property name="text" type="java.lang.String" value="Vuelto :"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JButton" name="btnCalc">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" value="Calculadora"/>
|
||||||
|
</Properties>
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnCalcActionPerformed"/>
|
||||||
|
</Events>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JLabel" name="jLabel6">
|
||||||
|
<Properties>
|
||||||
|
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
|
||||||
|
<Font name="Dialog" size="14" style="0"/>
|
||||||
|
</Property>
|
||||||
|
<Property name="text" type="java.lang.String" value="Cantidad :"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JSpinner" name="jspCant">
|
||||||
|
<Properties>
|
||||||
|
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
|
||||||
|
<Font name="Dialog" size="14" style="0"/>
|
||||||
|
</Property>
|
||||||
|
<Property name="model" type="javax.swing.SpinnerModel" editor="org.netbeans.modules.form.editors2.SpinnerModelEditor">
|
||||||
|
<SpinnerModel initial="1" minimum="1" numberType="java.lang.Integer" stepSize="1" type="number"/>
|
||||||
|
</Property>
|
||||||
|
<Property name="enabled" type="boolean" value="false"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JButton" name="btnNvaVenta">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" value="Nueva Venta"/>
|
||||||
|
</Properties>
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnNvaVentaActionPerformed"/>
|
||||||
|
</Events>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JFormattedTextField" name="jfEfectivo">
|
||||||
|
<Properties>
|
||||||
|
<Property name="formatterFactory" type="javax.swing.JFormattedTextField$AbstractFormatterFactory" editor="org.netbeans.modules.form.editors.AbstractFormatterFactoryEditor">
|
||||||
|
<Format subtype="1" type="0"/>
|
||||||
|
</Property>
|
||||||
|
<Property name="horizontalAlignment" type="int" value="0"/>
|
||||||
|
<Property name="enabled" type="boolean" value="false"/>
|
||||||
|
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
|
||||||
|
<Font name="Dialog" size="14" style="0"/>
|
||||||
|
</Property>
|
||||||
|
</Properties>
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="focusGained" listener="java.awt.event.FocusListener" parameters="java.awt.event.FocusEvent" handler="jfEfectivoFocusGained"/>
|
||||||
|
<EventHandler event="keyPressed" listener="java.awt.event.KeyListener" parameters="java.awt.event.KeyEvent" handler="jfEfectivoKeyPressed"/>
|
||||||
|
<EventHandler event="keyTyped" listener="java.awt.event.KeyListener" parameters="java.awt.event.KeyEvent" handler="jfEfectivoKeyTyped"/>
|
||||||
|
</Events>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JButton" name="btnConsulta">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" value="Consulta"/>
|
||||||
|
</Properties>
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnConsultaActionPerformed"/>
|
||||||
|
</Events>
|
||||||
|
</Component>
|
||||||
|
</SubComponents>
|
||||||
|
</Form>
|
598
src/Vista/MenuPrincipal.java
Normal file
598
src/Vista/MenuPrincipal.java
Normal file
@ -0,0 +1,598 @@
|
|||||||
|
package Vista; /** @author jp.av.dev@gmail.com */
|
||||||
|
|
||||||
|
import java.awt.Toolkit;
|
||||||
|
import java.awt.event.KeyEvent;
|
||||||
|
import java.awt.event.KeyListener;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.logging.Level;
|
||||||
|
import java.util.logging.Logger;
|
||||||
|
import javax.swing.ImageIcon;
|
||||||
|
import javax.swing.JOptionPane;
|
||||||
|
import static javax.swing.SwingConstants.CENTER;
|
||||||
|
import javax.swing.SwingUtilities;
|
||||||
|
import javax.swing.table.DefaultTableCellRenderer;
|
||||||
|
import javax.swing.table.DefaultTableModel;
|
||||||
|
import modelo.ListaProdsVenta;
|
||||||
|
import modelo.ListaProductos;
|
||||||
|
import modelo.Producto;
|
||||||
|
import modelo.ProductoVenta;
|
||||||
|
import modelo.Venta;
|
||||||
|
|
||||||
|
|
||||||
|
public class MenuPrincipal extends javax.swing.JFrame {
|
||||||
|
private static MantenedorProductos mp;
|
||||||
|
private Venta venta; // {<ProductosVenta>, total, efectivo, usuario}
|
||||||
|
private ProductoVenta prodVent; // {Codigo, descripcion, cantidad, precio}
|
||||||
|
private ArrayList<ProductoVenta> productosVenta;
|
||||||
|
private ListaProdsVenta lpv;
|
||||||
|
private final String usuario;
|
||||||
|
private DefaultTableModel modeloTabla;
|
||||||
|
private ListaProductos lp;
|
||||||
|
private int total;
|
||||||
|
private DefaultTableCellRenderer centrar;
|
||||||
|
|
||||||
|
public MenuPrincipal(String usuario) {
|
||||||
|
this.usuario = usuario;
|
||||||
|
initComponents();
|
||||||
|
TablaVacia();
|
||||||
|
lp = new ListaProductos();
|
||||||
|
mp = new MantenedorProductos();
|
||||||
|
mp.setVisible(false);
|
||||||
|
btnNvaVenta.requestFocus();
|
||||||
|
jspCant.getEditor().getComponent(0).addKeyListener(new KeyListener() {
|
||||||
|
@Override
|
||||||
|
public void keyPressed(KeyEvent e) {
|
||||||
|
if (e.getKeyCode() == KeyEvent.VK_ENTER){
|
||||||
|
txtProd.requestFocus();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public void keyTyped(KeyEvent e) {}
|
||||||
|
@Override
|
||||||
|
public void keyReleased(KeyEvent e) {}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private void cargarModeloTablaVenta(ArrayList<ProductoVenta> lpv) {
|
||||||
|
total = 0;
|
||||||
|
String columnas[] = new String[]{"Código", "Producto", "Cantidad", "Precio", "SubTotal"};
|
||||||
|
modeloTabla = new DefaultTableModel(null, columnas);
|
||||||
|
for (int cont = 0;cont < lpv.size(); cont++) {
|
||||||
|
Object datos[]=new Object[5];
|
||||||
|
datos[0]= lpv.get(cont).getCod();
|
||||||
|
datos[1]= lpv.get(cont).getDescrip();
|
||||||
|
datos[2]= lpv.get(cont).getCant();
|
||||||
|
datos[3]= "$ "+lpv.get(cont).getPrecio()+ ".-";
|
||||||
|
datos[4]= "$ "+ (lpv.get(cont).getPrecio() * lpv.get(cont).getCant()) +".-";
|
||||||
|
total = total + (lpv.get(cont).getPrecio() * lpv.get(cont).getCant());
|
||||||
|
modeloTabla.addRow(datos);
|
||||||
|
txtTotal.setText("$ "+ String.valueOf(total) +".-");
|
||||||
|
tbVenta.setModel(modeloTabla);
|
||||||
|
FormatoTabla();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void TablaVacia() {
|
||||||
|
tbVenta.setModel(new DefaultTableModel(null, new String[]{"Código", "Producto", "Cantidad", "Precio", "SubTotal"}));
|
||||||
|
FormatoTabla();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void FormatoTabla() {
|
||||||
|
centrar = new DefaultTableCellRenderer();
|
||||||
|
centrar.setHorizontalAlignment(CENTER);
|
||||||
|
tbVenta.getColumnModel().getColumn(0).setPreferredWidth(40);
|
||||||
|
tbVenta.getColumnModel().getColumn(0).setCellRenderer(centrar);
|
||||||
|
tbVenta.getColumnModel().getColumn(1).setPreferredWidth(150);
|
||||||
|
tbVenta.getColumnModel().getColumn(2).setPreferredWidth(40);
|
||||||
|
tbVenta.getColumnModel().getColumn(2).setCellRenderer(centrar);
|
||||||
|
tbVenta.getColumnModel().getColumn(3).setPreferredWidth(50);
|
||||||
|
tbVenta.getColumnModel().getColumn(3).setCellRenderer(centrar);
|
||||||
|
tbVenta.getColumnModel().getColumn(4).setPreferredWidth(50);
|
||||||
|
tbVenta.getColumnModel().getColumn(4).setCellRenderer(centrar);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void nuevaVenta() {
|
||||||
|
productosVenta = new ArrayList<>();
|
||||||
|
lpv = new ListaProdsVenta(productosVenta);
|
||||||
|
txtProd.setEnabled(true);
|
||||||
|
jspCant.setEnabled(true);
|
||||||
|
txtProd.requestFocus();
|
||||||
|
btnNvaVenta.setEnabled(false);
|
||||||
|
btnGnrVenta.setEnabled(true);
|
||||||
|
txtTotal.setText("$ 0.-");
|
||||||
|
jfEfectivo.setValue((int)0);
|
||||||
|
jfEfectivo.setEnabled(true);
|
||||||
|
txtVuelto.setText("0");
|
||||||
|
btnBrrVnta.setEnabled(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void generarVenta() throws Exception {
|
||||||
|
if (productosVenta.size() > 0) {
|
||||||
|
Venta detalleVenta = new Venta(productosVenta, this.usuario);
|
||||||
|
int efectivo = Integer.parseInt(jfEfectivo.getValue().toString());
|
||||||
|
detalleVenta.setTotal(total);
|
||||||
|
detalleVenta.setEfectivo(efectivo);
|
||||||
|
txtVuelto.setText(String.valueOf(efectivo - total));
|
||||||
|
System.out.println(detalleVenta.toString());
|
||||||
|
txtProd.setText("");
|
||||||
|
jspCant.setValue(1);
|
||||||
|
txtProd.setEnabled(false);
|
||||||
|
jspCant.setEnabled(false);
|
||||||
|
btnQuitar.setEnabled(false);
|
||||||
|
btnGnrVenta.setEnabled(false);
|
||||||
|
btnNvaVenta.setEnabled(true);
|
||||||
|
btnNvaVenta.requestFocus();
|
||||||
|
total = 0;
|
||||||
|
txtTotal.setText("$ 0.-");
|
||||||
|
jfEfectivo.setValue(0);
|
||||||
|
jfEfectivo.setEnabled(false);
|
||||||
|
btnBrrVnta.setEnabled(false);
|
||||||
|
TablaVacia();
|
||||||
|
} else {
|
||||||
|
Toolkit.getDefaultToolkit().beep();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
|
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
|
||||||
|
private void initComponents() {
|
||||||
|
|
||||||
|
jMenuBar2 = new javax.swing.JMenuBar();
|
||||||
|
jMenu3 = new javax.swing.JMenu();
|
||||||
|
jMenu4 = new javax.swing.JMenu();
|
||||||
|
jMenuItem2 = new javax.swing.JMenuItem();
|
||||||
|
jScrollPane1 = new javax.swing.JScrollPane();
|
||||||
|
jTable1 = new javax.swing.JTable();
|
||||||
|
txtProd = new javax.swing.JTextField();
|
||||||
|
txtTotal = new javax.swing.JTextField();
|
||||||
|
txtVuelto = new javax.swing.JTextField();
|
||||||
|
jScrollPane2 = new javax.swing.JScrollPane();
|
||||||
|
tbVenta = new javax.swing.JTable();
|
||||||
|
btnQuitar = new javax.swing.JButton();
|
||||||
|
btnGnrVenta = new javax.swing.JButton();
|
||||||
|
btnBrrVnta = new javax.swing.JButton();
|
||||||
|
jLabel1 = new javax.swing.JLabel();
|
||||||
|
jLabel2 = new javax.swing.JLabel();
|
||||||
|
jLabel3 = new javax.swing.JLabel();
|
||||||
|
jLabel4 = new javax.swing.JLabel();
|
||||||
|
btnCalc = new javax.swing.JButton();
|
||||||
|
jLabel6 = new javax.swing.JLabel();
|
||||||
|
jspCant = new javax.swing.JSpinner();
|
||||||
|
btnNvaVenta = new javax.swing.JButton();
|
||||||
|
jfEfectivo = new javax.swing.JFormattedTextField();
|
||||||
|
btnConsulta = new javax.swing.JButton();
|
||||||
|
jMenuBar1 = new javax.swing.JMenuBar();
|
||||||
|
jMenu1 = new javax.swing.JMenu();
|
||||||
|
menuProd = new javax.swing.JMenuItem();
|
||||||
|
menuUser = new javax.swing.JMenuItem();
|
||||||
|
jMenu2 = new javax.swing.JMenu();
|
||||||
|
jMenuItem1 = new javax.swing.JMenuItem();
|
||||||
|
jMenu5 = new javax.swing.JMenu();
|
||||||
|
acercaDe = new javax.swing.JMenuItem();
|
||||||
|
|
||||||
|
jMenu3.setText("File");
|
||||||
|
jMenuBar2.add(jMenu3);
|
||||||
|
|
||||||
|
jMenu4.setText("Edit");
|
||||||
|
jMenuBar2.add(jMenu4);
|
||||||
|
|
||||||
|
jMenuItem2.setText("jMenuItem2");
|
||||||
|
|
||||||
|
jTable1.setModel(new javax.swing.table.DefaultTableModel(
|
||||||
|
new Object [][] {
|
||||||
|
{null, null, null, null},
|
||||||
|
{null, null, null, null},
|
||||||
|
{null, null, null, null},
|
||||||
|
{null, null, null, null}
|
||||||
|
},
|
||||||
|
new String [] {
|
||||||
|
"Title 1", "Title 2", "Title 3", "Title 4"
|
||||||
|
}
|
||||||
|
));
|
||||||
|
jScrollPane1.setViewportView(jTable1);
|
||||||
|
|
||||||
|
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
|
||||||
|
setTitle("Sistema de Ventas L.S.R. v 1.0");
|
||||||
|
setResizable(false);
|
||||||
|
|
||||||
|
txtProd.setFont(new java.awt.Font("Dialog", 0, 14)); // NOI18N
|
||||||
|
txtProd.setEnabled(false);
|
||||||
|
txtProd.addKeyListener(new java.awt.event.KeyAdapter() {
|
||||||
|
public void keyPressed(java.awt.event.KeyEvent evt) {
|
||||||
|
txtProdKeyPressed(evt);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
txtTotal.setEditable(false);
|
||||||
|
txtTotal.setFont(new java.awt.Font("Dialog", 1, 14)); // NOI18N
|
||||||
|
txtTotal.setHorizontalAlignment(javax.swing.JTextField.CENTER);
|
||||||
|
|
||||||
|
txtVuelto.setEditable(false);
|
||||||
|
txtVuelto.setFont(new java.awt.Font("Dialog", 0, 14)); // NOI18N
|
||||||
|
txtVuelto.setHorizontalAlignment(javax.swing.JTextField.CENTER);
|
||||||
|
|
||||||
|
tbVenta.getTableHeader().setReorderingAllowed(false);
|
||||||
|
jScrollPane2.setViewportView(tbVenta);
|
||||||
|
|
||||||
|
btnQuitar.setText("Quitar Producto");
|
||||||
|
btnQuitar.setEnabled(false);
|
||||||
|
btnQuitar.addActionListener(new java.awt.event.ActionListener() {
|
||||||
|
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||||
|
btnQuitarActionPerformed(evt);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
btnGnrVenta.setText("Generar Venta");
|
||||||
|
btnGnrVenta.setEnabled(false);
|
||||||
|
btnGnrVenta.addActionListener(new java.awt.event.ActionListener() {
|
||||||
|
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||||
|
btnGnrVentaActionPerformed(evt);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
btnBrrVnta.setText("Desechar");
|
||||||
|
btnBrrVnta.setEnabled(false);
|
||||||
|
btnBrrVnta.addActionListener(new java.awt.event.ActionListener() {
|
||||||
|
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||||
|
btnBrrVntaActionPerformed(evt);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
jLabel1.setFont(new java.awt.Font("Dialog", 0, 14)); // NOI18N
|
||||||
|
jLabel1.setText("Producto : ");
|
||||||
|
|
||||||
|
jLabel2.setFont(new java.awt.Font("Dialog", 1, 14)); // NOI18N
|
||||||
|
jLabel2.setText("TOTAL :");
|
||||||
|
|
||||||
|
jLabel3.setFont(new java.awt.Font("Dialog", 0, 12)); // NOI18N
|
||||||
|
jLabel3.setText("Efectivo :");
|
||||||
|
|
||||||
|
jLabel4.setFont(new java.awt.Font("Dialog", 0, 12)); // NOI18N
|
||||||
|
jLabel4.setText("Vuelto :");
|
||||||
|
|
||||||
|
btnCalc.setText("Calculadora");
|
||||||
|
btnCalc.addActionListener(new java.awt.event.ActionListener() {
|
||||||
|
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||||
|
btnCalcActionPerformed(evt);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
jLabel6.setFont(new java.awt.Font("Dialog", 0, 14)); // NOI18N
|
||||||
|
jLabel6.setText("Cantidad :");
|
||||||
|
|
||||||
|
jspCant.setFont(new java.awt.Font("Dialog", 0, 14)); // NOI18N
|
||||||
|
jspCant.setModel(new javax.swing.SpinnerNumberModel(1, 1, null, 1));
|
||||||
|
jspCant.setEnabled(false);
|
||||||
|
|
||||||
|
btnNvaVenta.setText("Nueva Venta");
|
||||||
|
btnNvaVenta.addActionListener(new java.awt.event.ActionListener() {
|
||||||
|
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||||
|
btnNvaVentaActionPerformed(evt);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
jfEfectivo.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.NumberFormatter(java.text.NumberFormat.getIntegerInstance())));
|
||||||
|
jfEfectivo.setHorizontalAlignment(javax.swing.JTextField.CENTER);
|
||||||
|
jfEfectivo.setEnabled(false);
|
||||||
|
jfEfectivo.setFont(new java.awt.Font("Dialog", 0, 14)); // NOI18N
|
||||||
|
jfEfectivo.addFocusListener(new java.awt.event.FocusAdapter() {
|
||||||
|
public void focusGained(java.awt.event.FocusEvent evt) {
|
||||||
|
jfEfectivoFocusGained(evt);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
jfEfectivo.addKeyListener(new java.awt.event.KeyAdapter() {
|
||||||
|
public void keyPressed(java.awt.event.KeyEvent evt) {
|
||||||
|
jfEfectivoKeyPressed(evt);
|
||||||
|
}
|
||||||
|
public void keyTyped(java.awt.event.KeyEvent evt) {
|
||||||
|
jfEfectivoKeyTyped(evt);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
btnConsulta.setText("Consulta");
|
||||||
|
btnConsulta.addActionListener(new java.awt.event.ActionListener() {
|
||||||
|
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||||
|
btnConsultaActionPerformed(evt);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
jMenu1.setText("Mantenedores");
|
||||||
|
|
||||||
|
menuProd.setText("de Productos");
|
||||||
|
menuProd.addActionListener(new java.awt.event.ActionListener() {
|
||||||
|
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||||
|
menuProdActionPerformed(evt);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
jMenu1.add(menuProd);
|
||||||
|
|
||||||
|
menuUser.setText("de Usuarios");
|
||||||
|
menuUser.addActionListener(new java.awt.event.ActionListener() {
|
||||||
|
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||||
|
menuUserActionPerformed(evt);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
jMenu1.add(menuUser);
|
||||||
|
|
||||||
|
jMenuBar1.add(jMenu1);
|
||||||
|
|
||||||
|
jMenu2.setText("Editor");
|
||||||
|
|
||||||
|
jMenuItem1.setText("Anular Venta");
|
||||||
|
jMenuItem1.addActionListener(new java.awt.event.ActionListener() {
|
||||||
|
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||||
|
jMenuItem1ActionPerformed(evt);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
jMenu2.add(jMenuItem1);
|
||||||
|
|
||||||
|
jMenuBar1.add(jMenu2);
|
||||||
|
|
||||||
|
jMenu5.setText("Ayuda");
|
||||||
|
|
||||||
|
acercaDe.setText("Acerca de");
|
||||||
|
acercaDe.addActionListener(new java.awt.event.ActionListener() {
|
||||||
|
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||||
|
acercaDeActionPerformed(evt);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
jMenu5.add(acercaDe);
|
||||||
|
|
||||||
|
jMenuBar1.add(jMenu5);
|
||||||
|
|
||||||
|
setJMenuBar(jMenuBar1);
|
||||||
|
|
||||||
|
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
|
||||||
|
getContentPane().setLayout(layout);
|
||||||
|
layout.setHorizontalGroup(
|
||||||
|
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
|
.addGroup(layout.createSequentialGroup()
|
||||||
|
.addContainerGap()
|
||||||
|
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
|
.addGroup(layout.createSequentialGroup()
|
||||||
|
.addGap(9, 9, 9)
|
||||||
|
.addComponent(jLabel1)
|
||||||
|
.addGap(3, 3, 3)
|
||||||
|
.addComponent(txtProd, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||||
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
|
||||||
|
.addComponent(jLabel6)
|
||||||
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||||
|
.addComponent(jspCant, javax.swing.GroupLayout.PREFERRED_SIZE, 60, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||||
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 56, Short.MAX_VALUE)
|
||||||
|
.addComponent(btnQuitar))
|
||||||
|
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
|
||||||
|
.addComponent(btnCalc)
|
||||||
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||||
|
.addComponent(btnConsulta, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||||
|
.addGap(18, 18, 18)
|
||||||
|
.addComponent(btnNvaVenta)
|
||||||
|
.addGap(18, 18, 18)
|
||||||
|
.addComponent(btnBrrVnta, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||||
|
.addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 485, Short.MAX_VALUE))
|
||||||
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||||
|
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
|
.addComponent(txtTotal, javax.swing.GroupLayout.Alignment.TRAILING)
|
||||||
|
.addGroup(layout.createSequentialGroup()
|
||||||
|
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
|
.addComponent(jLabel3)
|
||||||
|
.addComponent(jLabel2)
|
||||||
|
.addComponent(jLabel4))
|
||||||
|
.addGap(0, 66, Short.MAX_VALUE))
|
||||||
|
.addComponent(jfEfectivo)
|
||||||
|
.addComponent(txtVuelto)
|
||||||
|
.addComponent(btnGnrVenta, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||||
|
.addContainerGap())
|
||||||
|
);
|
||||||
|
layout.setVerticalGroup(
|
||||||
|
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
|
.addGroup(layout.createSequentialGroup()
|
||||||
|
.addContainerGap()
|
||||||
|
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
|
||||||
|
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||||
|
.addComponent(txtProd, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||||
|
.addComponent(jLabel1)
|
||||||
|
.addComponent(jLabel6))
|
||||||
|
.addComponent(jspCant)
|
||||||
|
.addComponent(btnQuitar, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||||
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 15, Short.MAX_VALUE)
|
||||||
|
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
|
||||||
|
.addGroup(layout.createSequentialGroup()
|
||||||
|
.addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 200, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||||
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED))
|
||||||
|
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
|
||||||
|
.addComponent(jLabel2)
|
||||||
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||||
|
.addComponent(txtTotal, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||||
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
|
||||||
|
.addComponent(jLabel3)
|
||||||
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||||
|
.addComponent(jfEfectivo, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||||
|
.addGap(18, 18, 18)
|
||||||
|
.addComponent(jLabel4)
|
||||||
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||||
|
.addComponent(txtVuelto, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||||
|
.addGap(23, 23, 23)))
|
||||||
|
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
|
||||||
|
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||||
|
.addComponent(btnGnrVenta, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||||
|
.addComponent(btnBrrVnta, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||||
|
.addComponent(btnCalc, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||||
|
.addComponent(btnConsulta, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||||
|
.addComponent(btnNvaVenta, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||||
|
.addContainerGap())
|
||||||
|
);
|
||||||
|
|
||||||
|
pack();
|
||||||
|
}// </editor-fold>//GEN-END:initComponents
|
||||||
|
|
||||||
|
private void menuProdActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_menuProdActionPerformed
|
||||||
|
mp.setLocationRelativeTo(null);
|
||||||
|
mp.setVisible(true);
|
||||||
|
}//GEN-LAST:event_menuProdActionPerformed
|
||||||
|
|
||||||
|
private void menuUserActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_menuUserActionPerformed
|
||||||
|
MantenedorUsuarios mu = new MantenedorUsuarios();
|
||||||
|
mu.setVisible(true);
|
||||||
|
mu.setLocationRelativeTo(null);
|
||||||
|
}//GEN-LAST:event_menuUserActionPerformed
|
||||||
|
|
||||||
|
private void acercaDeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_acercaDeActionPerformed
|
||||||
|
ImageIcon iconoAyuda = new ImageIcon(getClass().getResource("/imagenes/asia.gif"));
|
||||||
|
JOptionPane.showMessageDialog(this, "Sistema de Ventas \"LSR\" v1.0\n /** author */\n jp.av.dev@gmail.com\n","Acerca de", JOptionPane.INFORMATION_MESSAGE, iconoAyuda);
|
||||||
|
}//GEN-LAST:event_acercaDeActionPerformed
|
||||||
|
|
||||||
|
private void btnCalcActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCalcActionPerformed
|
||||||
|
try {
|
||||||
|
Runtime rt = Runtime.getRuntime();
|
||||||
|
Process p = rt.exec("calc");
|
||||||
|
p.waitFor();
|
||||||
|
} catch (IOException | InterruptedException ex) {
|
||||||
|
Logger.getLogger(MenuPrincipal.class.getName()).log(Level.SEVERE, null, ex);
|
||||||
|
}
|
||||||
|
}//GEN-LAST:event_btnCalcActionPerformed
|
||||||
|
|
||||||
|
private void txtProdKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtProdKeyPressed
|
||||||
|
if (evt.getKeyCode() == KeyEvent.VK_ENTER) {
|
||||||
|
if (!"".equals(txtProd.getText())) {
|
||||||
|
if (!"".equals( (MantenedorProductos.getLp().buscarProducto( txtProd.getText()).getCodigo()) )) {
|
||||||
|
Producto prodTemp = MantenedorProductos.getLp().buscarProducto(txtProd.getText());
|
||||||
|
prodVent = new ProductoVenta(prodTemp.getCodigo(), prodTemp.getDescripcion(), (int)jspCant.getValue(), prodTemp.getPrecio());
|
||||||
|
lpv.agregarProdVenta(prodVent);
|
||||||
|
cargarModeloTablaVenta(lpv.getLpv());
|
||||||
|
btnQuitar.setEnabled(true);
|
||||||
|
} else {
|
||||||
|
Toolkit.getDefaultToolkit().beep();
|
||||||
|
}
|
||||||
|
txtProd.setText("");
|
||||||
|
jspCant.setValue(1);
|
||||||
|
} else {
|
||||||
|
Toolkit.getDefaultToolkit().beep();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}//GEN-LAST:event_txtProdKeyPressed
|
||||||
|
|
||||||
|
private void btnNvaVentaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnNvaVentaActionPerformed
|
||||||
|
nuevaVenta();
|
||||||
|
}//GEN-LAST:event_btnNvaVentaActionPerformed
|
||||||
|
|
||||||
|
private void btnGnrVentaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnGnrVentaActionPerformed
|
||||||
|
try {
|
||||||
|
generarVenta();
|
||||||
|
} catch (Exception ex) {
|
||||||
|
System.out.println("Excepcion! en generar venta"); // COMPROBAR Y ELIMINAR *********************************** ////////////////////////
|
||||||
|
}
|
||||||
|
}//GEN-LAST:event_btnGnrVentaActionPerformed
|
||||||
|
|
||||||
|
private void btnConsultaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnConsultaActionPerformed
|
||||||
|
Producto p = lp.buscarProducto(JOptionPane.showInputDialog(this, "Ingresar Código de producto :", "Consulta Producto", JOptionPane.QUESTION_MESSAGE));
|
||||||
|
if (!"".equals(p.getCodigo())) {
|
||||||
|
JOptionPane.showMessageDialog(this, p.toString(), "Detalle Producto ", JOptionPane.INFORMATION_MESSAGE);
|
||||||
|
} else {
|
||||||
|
JOptionPane.showMessageDialog(this, " Producto no existe", "No encontrado",JOptionPane.WARNING_MESSAGE);
|
||||||
|
} if (txtProd.isEnabled()) {
|
||||||
|
txtProd.requestFocus();
|
||||||
|
} else {
|
||||||
|
btnNvaVenta.requestFocus();
|
||||||
|
}
|
||||||
|
}//GEN-LAST:event_btnConsultaActionPerformed
|
||||||
|
|
||||||
|
private void jfEfectivoFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_jfEfectivoFocusGained
|
||||||
|
SwingUtilities.invokeLater(() -> {
|
||||||
|
jfEfectivo.selectAll();
|
||||||
|
});
|
||||||
|
}//GEN-LAST:event_jfEfectivoFocusGained
|
||||||
|
|
||||||
|
private void btnBrrVntaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnBrrVntaActionPerformed
|
||||||
|
TablaVacia();
|
||||||
|
txtTotal.setText("$ 0.-");
|
||||||
|
productosVenta.clear();
|
||||||
|
btnBrrVnta.setEnabled(false);
|
||||||
|
btnGnrVenta.setEnabled(false);
|
||||||
|
btnNvaVenta.setEnabled(true);
|
||||||
|
btnQuitar.setEnabled(false);
|
||||||
|
txtProd.setEnabled(false);
|
||||||
|
jspCant.setEnabled(false);
|
||||||
|
btnNvaVenta.requestFocus();
|
||||||
|
jfEfectivo.setEnabled(false);
|
||||||
|
txtProd.setText("");
|
||||||
|
jspCant.setValue(1);
|
||||||
|
}//GEN-LAST:event_btnBrrVntaActionPerformed
|
||||||
|
|
||||||
|
private void jfEfectivoKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jfEfectivoKeyPressed
|
||||||
|
if (evt.getKeyCode() == KeyEvent.VK_ENTER) {
|
||||||
|
SwingUtilities.invokeLater(() -> { try {generarVenta();} catch (Exception ex) {} });
|
||||||
|
}
|
||||||
|
}//GEN-LAST:event_jfEfectivoKeyPressed
|
||||||
|
|
||||||
|
private void jfEfectivoKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jfEfectivoKeyTyped
|
||||||
|
char caracter = evt.getKeyChar();
|
||||||
|
if(((caracter < '0') || (caracter > '9')) && (caracter != '\b')) {
|
||||||
|
evt.consume(); // ignorar el evento de teclado
|
||||||
|
}
|
||||||
|
}//GEN-LAST:event_jfEfectivoKeyTyped
|
||||||
|
|
||||||
|
private void jMenuItem1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem1ActionPerformed
|
||||||
|
// Al anular una venta id_venta - 1
|
||||||
|
}//GEN-LAST:event_jMenuItem1ActionPerformed
|
||||||
|
|
||||||
|
private void btnQuitarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnQuitarActionPerformed
|
||||||
|
if (!"".equals(txtProd.getText())) {
|
||||||
|
char result = lpv.quitarProdVenta(txtProd.getText());
|
||||||
|
switch (result) {
|
||||||
|
case 'v': // si el array está vacio
|
||||||
|
btnQuitar.setEnabled(false);
|
||||||
|
TablaVacia();
|
||||||
|
txtTotal.setText("$ 0.-");
|
||||||
|
jfEfectivo.setValue(0);
|
||||||
|
break;
|
||||||
|
case 'b': // si se eliminó un producto del array
|
||||||
|
cargarModeloTablaVenta(lpv.getLpv());
|
||||||
|
break;
|
||||||
|
default: // si nó se encontró el producto
|
||||||
|
Toolkit.getDefaultToolkit().beep();
|
||||||
|
txtProd.requestFocus();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Toolkit.getDefaultToolkit().beep();
|
||||||
|
}
|
||||||
|
txtProd.setText("");
|
||||||
|
txtProd.requestFocus();
|
||||||
|
}//GEN-LAST:event_btnQuitarActionPerformed
|
||||||
|
|
||||||
|
|
||||||
|
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||||
|
private javax.swing.JMenuItem acercaDe;
|
||||||
|
private javax.swing.JButton btnBrrVnta;
|
||||||
|
private javax.swing.JButton btnCalc;
|
||||||
|
private javax.swing.JButton btnConsulta;
|
||||||
|
private javax.swing.JButton btnGnrVenta;
|
||||||
|
private javax.swing.JButton btnNvaVenta;
|
||||||
|
private javax.swing.JButton btnQuitar;
|
||||||
|
private javax.swing.JLabel jLabel1;
|
||||||
|
private javax.swing.JLabel jLabel2;
|
||||||
|
private javax.swing.JLabel jLabel3;
|
||||||
|
private javax.swing.JLabel jLabel4;
|
||||||
|
private javax.swing.JLabel jLabel6;
|
||||||
|
private javax.swing.JMenu jMenu1;
|
||||||
|
private javax.swing.JMenu jMenu2;
|
||||||
|
private javax.swing.JMenu jMenu3;
|
||||||
|
private javax.swing.JMenu jMenu4;
|
||||||
|
private javax.swing.JMenu jMenu5;
|
||||||
|
private javax.swing.JMenuBar jMenuBar1;
|
||||||
|
private javax.swing.JMenuBar jMenuBar2;
|
||||||
|
private javax.swing.JMenuItem jMenuItem1;
|
||||||
|
private javax.swing.JMenuItem jMenuItem2;
|
||||||
|
private javax.swing.JScrollPane jScrollPane1;
|
||||||
|
private javax.swing.JScrollPane jScrollPane2;
|
||||||
|
private javax.swing.JTable jTable1;
|
||||||
|
private javax.swing.JFormattedTextField jfEfectivo;
|
||||||
|
private javax.swing.JSpinner jspCant;
|
||||||
|
private javax.swing.JMenuItem menuProd;
|
||||||
|
private javax.swing.JMenuItem menuUser;
|
||||||
|
private javax.swing.JTable tbVenta;
|
||||||
|
private javax.swing.JTextField txtProd;
|
||||||
|
private javax.swing.JTextField txtTotal;
|
||||||
|
private javax.swing.JTextField txtVuelto;
|
||||||
|
// End of variables declaration//GEN-END:variables
|
||||||
|
}
|
BIN
src/imagenes/asia.gif
Normal file
BIN
src/imagenes/asia.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.6 MiB |
BIN
src/imagenes/braingridcircuitboard.png
Normal file
BIN
src/imagenes/braingridcircuitboard.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 329 KiB |
63
src/modelo/ListaProdsVenta.java
Normal file
63
src/modelo/ListaProdsVenta.java
Normal file
@ -0,0 +1,63 @@
|
|||||||
|
package modelo; /** @author jp.av.dev@gmail.com */
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
|
||||||
|
public class ListaProdsVenta { //El proposito de esta clase es gestionar las cantidades de productos del array...
|
||||||
|
|
||||||
|
private ArrayList<ProductoVenta> lpv;
|
||||||
|
|
||||||
|
public ListaProdsVenta() {}
|
||||||
|
|
||||||
|
public ListaProdsVenta(ArrayList<ProductoVenta> lpv) {
|
||||||
|
this.lpv = lpv;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ArrayList<ProductoVenta> getLpv() {
|
||||||
|
return lpv;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLpv(ArrayList<ProductoVenta> lpv) {
|
||||||
|
this.lpv = lpv;
|
||||||
|
}
|
||||||
|
|
||||||
|
public char quitarProdVenta(String codigo) {
|
||||||
|
char result = 'a';
|
||||||
|
for (int i = 0; i < lpv.size(); i++) {
|
||||||
|
if ( lpv.get(i).getCod().equals(codigo) ) {
|
||||||
|
lpv.remove(i);
|
||||||
|
result = 'b';
|
||||||
|
} else {
|
||||||
|
result = 'n';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (lpv.isEmpty()) {
|
||||||
|
result = 'v';
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void agregarProdVenta(ProductoVenta prodVenta) { // Busca si existe el producto en el ArrayProductosVenta lpv
|
||||||
|
boolean nuevo = true;
|
||||||
|
if (lpv.isEmpty()) {
|
||||||
|
lpv.add(prodVenta);
|
||||||
|
} else {
|
||||||
|
for (int i = 0; i < lpv.size(); i++) {
|
||||||
|
if ( lpv.get(i).getCod().equals(prodVenta.getCod()) ) {
|
||||||
|
nuevo = false;
|
||||||
|
lpv.get(i).setCant(lpv.get(i).getCant() + prodVenta.getCant()); // Si existe suma sus cantidades
|
||||||
|
}
|
||||||
|
} if (nuevo == true) {
|
||||||
|
lpv.add(prodVenta); // Si no existe agrega el productoVenta al ArrayProductosVenta lpv
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "ListaProdsVenta{" + "lpv=" + lpv + '}';
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
57
src/modelo/ListaProductos.java
Normal file
57
src/modelo/ListaProductos.java
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
package modelo; /** @author jp.av.dev@gmail.com */
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
|
||||||
|
public class ListaProductos {
|
||||||
|
|
||||||
|
private static ArrayList<Producto> lp;
|
||||||
|
|
||||||
|
public ListaProductos() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public ListaProductos(ArrayList<Producto> lp) {
|
||||||
|
ListaProductos.lp = lp;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ArrayList<Producto> getLp() {
|
||||||
|
return lp;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLp(ArrayList<Producto> lp) {
|
||||||
|
ListaProductos.lp = lp;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void crearProducto(String codigo, String descripcion, int precio, int stock, int stockMin ) {
|
||||||
|
Producto prod = new Producto(codigo, descripcion, precio, stock, stockMin);
|
||||||
|
ListaProductos.lp.add(prod);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Producto buscarProducto(String codigo) {
|
||||||
|
for (int i = 0; i < lp.size(); i++) {
|
||||||
|
if ( lp.get(i).getCodigo().equals(codigo) ) {
|
||||||
|
return lp.get(i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Producto productoNoExiste = new Producto("","",0,0,0);
|
||||||
|
return productoNoExiste;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean eliminarProducto(String codigo) {
|
||||||
|
return lp.remove(buscarProducto(codigo));
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean editarProducto(Producto editarProd) {
|
||||||
|
if ( !"".equals((buscarProducto(editarProd.getCodigo())).getCodigo()) ) {
|
||||||
|
buscarProducto(editarProd.getCodigo()).setDescripcion(editarProd.getDescripcion());
|
||||||
|
buscarProducto(editarProd.getCodigo()).setPrecio(editarProd.getPrecio());
|
||||||
|
buscarProducto(editarProd.getCodigo()).setStock(editarProd.getStock());
|
||||||
|
buscarProducto(editarProd.getCodigo()).setStockMin(editarProd.getStockMin());
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
70
src/modelo/Producto.java
Normal file
70
src/modelo/Producto.java
Normal file
@ -0,0 +1,70 @@
|
|||||||
|
package modelo; /** @author jp.av.dev@gmail.com */
|
||||||
|
|
||||||
|
|
||||||
|
public class Producto {
|
||||||
|
private String codigo;
|
||||||
|
private String descripcion;
|
||||||
|
private int stock;
|
||||||
|
private int stockMin;// Stock mínimo
|
||||||
|
private int precio;
|
||||||
|
|
||||||
|
public Producto() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public Producto(String codigo, String descripcion, int precio, int stock, int stockMin) {
|
||||||
|
this.codigo = codigo;
|
||||||
|
this.descripcion = descripcion;
|
||||||
|
this.precio = precio;
|
||||||
|
this.stock = stock;
|
||||||
|
this.stockMin = stockMin;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "Producto Código: " + codigo + "\nDescripcion: " + descripcion + "\nPrecio: $ " + precio + ".-"+ "\nStock Actual: " + stock + "\nStock Mínimo: " + stockMin;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCodigo() {
|
||||||
|
return codigo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCodigo(String codigo) {
|
||||||
|
this.codigo = codigo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDescripcion() {
|
||||||
|
return descripcion;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDescripcion(String descripcion) {
|
||||||
|
this.descripcion = descripcion;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getStock() {
|
||||||
|
return stock;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStock(int stock) {
|
||||||
|
this.stock = stock;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getStockMin() {
|
||||||
|
return stockMin;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStockMin(int stockMin) {
|
||||||
|
this.stockMin = stockMin;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getPrecio() {
|
||||||
|
return precio;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPrecio(int precio) {
|
||||||
|
this.precio = precio;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
55
src/modelo/ProductoVenta.java
Normal file
55
src/modelo/ProductoVenta.java
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
package modelo; /** @author jp.av.dev@gmail.com */
|
||||||
|
|
||||||
|
public class ProductoVenta {
|
||||||
|
private String cod;
|
||||||
|
private String descrip;
|
||||||
|
private int cant;
|
||||||
|
private int precio;
|
||||||
|
|
||||||
|
public ProductoVenta(String cod, String descrip, int cant, int precio) {
|
||||||
|
this.cod = cod;
|
||||||
|
this.descrip = descrip;
|
||||||
|
this.cant = cant;
|
||||||
|
this.precio = precio;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "\bItem Código: " + cod +"\n"+ descrip + "\nDetalle: " + cant + " x $ " + precio + ".-\n\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCod() {
|
||||||
|
return cod;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCod(String cod) {
|
||||||
|
this.cod = cod;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDescrip() {
|
||||||
|
return descrip;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDescrip(String descrip) {
|
||||||
|
this.descrip = descrip;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getCant() {
|
||||||
|
return cant;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCant(int cant) {
|
||||||
|
this.cant = cant;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getPrecio() {
|
||||||
|
return precio;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPrecio(int precio) {
|
||||||
|
this.precio = precio;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
22
src/modelo/Usuario.java
Normal file
22
src/modelo/Usuario.java
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
package modelo; /** @author jp.av.dev@gmail.com */
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
|
||||||
|
public class Usuario {
|
||||||
|
|
||||||
|
String nombre;
|
||||||
|
char[] pass;
|
||||||
|
ArrayList<Usuario> ListaUsuarios = new ArrayList<>();
|
||||||
|
|
||||||
|
public Usuario(String nombre, char[] pass) {
|
||||||
|
this.nombre = nombre;
|
||||||
|
this.pass = pass;
|
||||||
|
addUser(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void addUser(Usuario user) {
|
||||||
|
ListaUsuarios.add(user);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
72
src/modelo/Venta.java
Normal file
72
src/modelo/Venta.java
Normal file
@ -0,0 +1,72 @@
|
|||||||
|
package modelo; /** @author jp.av.dev@gmail.com */
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Calendar;
|
||||||
|
|
||||||
|
|
||||||
|
public class Venta {
|
||||||
|
|
||||||
|
private ArrayList<ProductoVenta> ProductosVenta;
|
||||||
|
private int total;
|
||||||
|
private final String fecha;
|
||||||
|
private int efectivo;
|
||||||
|
private final String usuario;
|
||||||
|
private static int idVenta = 0;
|
||||||
|
|
||||||
|
public Venta(ArrayList<ProductoVenta> ProductosVenta, String usuario) {
|
||||||
|
this.ProductosVenta = ProductosVenta;
|
||||||
|
this.total = 0;
|
||||||
|
this.efectivo = 0;
|
||||||
|
this.fecha = (Calendar.getInstance().getTime().toString()).replace("CLST", "");
|
||||||
|
this.usuario = usuario;
|
||||||
|
Venta.idVenta = ++idVenta;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setProductosVenta(ArrayList<ProductoVenta> ProductosVenta) {
|
||||||
|
this.ProductosVenta = ProductosVenta;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTotal(int total) {
|
||||||
|
this.total = total;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEfectivo(int efectivo) {
|
||||||
|
this.efectivo = efectivo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ArrayList<ProductoVenta> getProductosVenta() {
|
||||||
|
return ProductosVenta;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getTotal() {
|
||||||
|
return total;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFecha() {
|
||||||
|
return fecha;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getEfectivo() {
|
||||||
|
return efectivo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUsuario() {
|
||||||
|
return usuario;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "Venta N° "+ idVenta +" Vend. "+ usuario +"\n"+ fecha +"\n______________________________\n"+
|
||||||
|
"\nProductos :\n," +
|
||||||
|
ProductosVenta + "\b" +
|
||||||
|
"\n\tTOTAL = $ "+ total +".-\n\n"+
|
||||||
|
"Monto Cancelado = $ "+ efectivo +".-\n"+
|
||||||
|
"Vuelto = $ "+ (efectivo - total) +".-\n______________________________\n"+
|
||||||
|
"Gracias por preferirnos.\nHasta pronto!\n\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getIdVenta() {
|
||||||
|
return idVenta;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
23
src/sistema_de_ventas_lsr/Sistema_de_Ventas_LSR.java
Normal file
23
src/sistema_de_ventas_lsr/Sistema_de_Ventas_LSR.java
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
package sistema_de_ventas_lsr; /** @author jp.av.dev@gmail.com */
|
||||||
|
|
||||||
|
import Vista.LogInUser;
|
||||||
|
import java.util.logging.Level;
|
||||||
|
import java.util.logging.Logger;
|
||||||
|
import javax.swing.UIManager;
|
||||||
|
import javax.swing.UnsupportedLookAndFeelException;
|
||||||
|
|
||||||
|
|
||||||
|
public class Sistema_de_Ventas_LSR {
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
LogInUser p = new LogInUser();
|
||||||
|
p.setVisible(true);
|
||||||
|
p.setLocationRelativeTo(null);
|
||||||
|
try {
|
||||||
|
UIManager.setLookAndFeel("com.jtattoo.plaf.aluminium.AluminiumLookAndFeel");//aluminium.AluminiumLookAndFeel //hifi.HiFiLookAndFeel //noire.NoireLookAndFeel //acryl.AcrylLookAndFeel //graphite.GraphiteLookAndFeel //texture.TextureLookAndFeel //luna.LunaLookAndFeel //smart.SmartLookAndFeel //mint.MintLookAndFeel //mcwin.McWinLookAndFeel
|
||||||
|
} catch (ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException ex) {
|
||||||
|
Logger.getLogger(Sistema_de_Ventas_LSR.class.getName()).log(Level.SEVERE, null, ex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user