hexsha
stringlengths
40
40
size
int64
8
1.04M
content
stringlengths
8
1.04M
avg_line_length
float64
2.24
100
max_line_length
int64
4
1k
alphanum_fraction
float64
0.25
0.97
1c69c232e3c3dd5821f534c8b226ff4206554928
8,396
/* * Copyright Debezium Authors. * * Licensed under the Apache Software License version 2.0, available at http://www.apache.org/licenses/LICENSE-2.0 */ package io.debezium.connector.postgresql; import static io.debezium.connector.postgresql.TestHelper.topicName; import static org.apache.kafka.connect.transforms.util.Requirements.requireStruct; import static org.fest.assertions.Assertions.assertThat; import java.util.Collections; import java.util.HashMap; import java.util.Map; import java.util.UUID; import org.apache.kafka.connect.data.SchemaBuilder; import org.apache.kafka.connect.data.Struct; import org.apache.kafka.connect.header.Header; import org.apache.kafka.connect.header.Headers; import org.apache.kafka.connect.source.SourceRecord; import org.codehaus.jackson.JsonNode; import org.codehaus.jackson.map.ObjectMapper; import org.junit.After; import org.junit.Before; import org.junit.Test; import io.debezium.config.Configuration; import io.debezium.connector.postgresql.PostgresConnectorConfig.SnapshotMode; import io.debezium.data.Uuid; import io.debezium.embedded.AbstractConnectorTest; import io.debezium.transforms.outbox.EventRouter; /** * Integration test for {@link io.debezium.transforms.outbox.EventRouter} with {@link PostgresConnector} * * @author Renato Mefi (gh@mefi.in) */ public class OutboxEventRouterIT extends AbstractConnectorTest { private static final String SETUP_OUTBOX_SCHEMA = "DROP SCHEMA IF EXISTS outboxsmtit CASCADE;" + "CREATE SCHEMA outboxsmtit;"; private static final String SETUP_OUTOBOX_TABLE = "CREATE TABLE outboxsmtit.outbox " + "(" + " id uuid not null" + " constraint outbox_pk primary key," + " aggregatetype varchar(255) not null," + " aggregateid varchar(255) not null," + " type varchar(255) not null," + " payload jsonb not null" + ");"; private EventRouter<SourceRecord> outboxEventRouter; private static String createEventInsert( UUID eventId, String eventType, String aggregateType, String aggregateId, String payloadJson, String additional ) { return String.format("INSERT INTO outboxsmtit.outbox VALUES (" + "'%s'" + ", '%s'" + ", '%s'" + ", '%s'" + ", '%s'::jsonb" + "%s" + ");", eventId, aggregateType, aggregateId, eventType, payloadJson, additional); } @Before public void beforeEach() { outboxEventRouter = new EventRouter<>(); outboxEventRouter.configure(Collections.emptyMap()); TestHelper.execute(SETUP_OUTBOX_SCHEMA); TestHelper.execute(SETUP_OUTOBOX_TABLE); Configuration.Builder configBuilder = TestHelper.defaultConfig() .with(PostgresConnectorConfig.SNAPSHOT_MODE, SnapshotMode.NEVER.getValue()) .with(PostgresConnectorConfig.DROP_SLOT_ON_STOP, Boolean.FALSE) .with(PostgresConnectorConfig.SCHEMA_WHITELIST, "outboxsmtit") .with(PostgresConnectorConfig.TABLE_WHITELIST, "outboxsmtit\\.outbox"); start(PostgresConnector.class, configBuilder.build()); assertConnectorIsRunning(); } @After public void afterEach() { stopConnector(); assertNoRecordsToConsume(); outboxEventRouter.close(); } @Test public void shouldConsumeRecordsFromInsert() throws Exception { TestHelper.execute(createEventInsert( UUID.fromString("59a42efd-b015-44a9-9dde-cb36d9002425"), "UserCreated", "User", "10711fa5", "{}", "" )); SourceRecords actualRecords = consumeRecordsByTopic(1); assertThat(actualRecords.topics().size()).isEqualTo(1); SourceRecord newEventRecord = actualRecords.recordsForTopic(topicName("outboxsmtit.outbox")).get(0); SourceRecord routedEvent = outboxEventRouter.apply(newEventRecord); assertThat(routedEvent).isNotNull(); assertThat(routedEvent.topic()).isEqualTo("outbox.event.user"); } @Test public void shouldRespectJsonFormatAsString() throws Exception { TestHelper.execute(createEventInsert( UUID.fromString("f9171eb6-19f3-4579-9206-0e179d2ebad7"), "UserCreated", "User", "7bdf2e9e", "{\"email\": \"gh@mefi.in\"}", "" )); SourceRecords actualRecords = consumeRecordsByTopic(1); assertThat(actualRecords.topics().size()).isEqualTo(1); SourceRecord newEventRecord = actualRecords.recordsForTopic(topicName("outboxsmtit.outbox")).get(0); SourceRecord routedEvent = outboxEventRouter.apply(newEventRecord); Struct valueStruct = requireStruct(routedEvent.value(), "test payload"); JsonNode payload = (new ObjectMapper()).readTree(valueStruct.getString("payload")); assertThat(payload.get("email").getTextValue()).isEqualTo("gh@mefi.in"); } @Test public void shouldSupportAllFeatures() throws Exception { outboxEventRouter = new EventRouter<>(); final Map<String, String> config = new HashMap<>(); config.put("table.field.event.schema.version", "version"); config.put("table.field.event.timestamp", "createdat"); config.put( "table.fields.additional.placement", "version:envelope:eventVersion," + "aggregatetype:envelope:aggregateType," + "somebooltype:envelope:someBoolType," + "somebooltype:header" ); outboxEventRouter.configure(config); TestHelper.execute("ALTER TABLE outboxsmtit.outbox add version int not null;"); TestHelper.execute("ALTER TABLE outboxsmtit.outbox add somebooltype boolean not null;"); TestHelper.execute("ALTER TABLE outboxsmtit.outbox add createdat timestamp without time zone not null;"); TestHelper.execute(createEventInsert( UUID.fromString("f9171eb6-19f3-4579-9206-0e179d2ebad7"), "UserUpdated", "UserEmail", "7bdf2e9e", "{\"email\": \"gh@mefi.in\"}", ", 1, true, TIMESTAMP '2019-03-24 20:52:59'" )); SourceRecords actualRecords = consumeRecordsByTopic(1); assertThat(actualRecords.topics().size()).isEqualTo(1); SourceRecord newEventRecord = actualRecords.recordsForTopic(topicName("outboxsmtit.outbox")).get(0); SourceRecord eventRouted = outboxEventRouter.apply(newEventRecord); // Validate metadata assertThat(eventRouted.valueSchema().version()).isEqualTo(1); assertThat(eventRouted.timestamp()).isEqualTo(1553460779000000L); assertThat(eventRouted.topic()).isEqualTo("outbox.event.useremail"); // Validate headers Headers headers = eventRouted.headers(); assertThat(headers.size()).isEqualTo(2); Header headerId = headers.lastWithName("id"); assertThat(headerId.schema()).isEqualTo(Uuid.schema()); assertThat(headerId.value()).isEqualTo("f9171eb6-19f3-4579-9206-0e179d2ebad7"); Header headerBool = headers.lastWithName("somebooltype"); assertThat(headerBool.schema()).isEqualTo(SchemaBuilder.BOOLEAN_SCHEMA); assertThat(headerBool.value()).isEqualTo(true); // Validate Key assertThat(eventRouted.keySchema()).isEqualTo(SchemaBuilder.STRING_SCHEMA); assertThat(eventRouted.key()).isEqualTo("7bdf2e9e"); // Validate message body Struct valueStruct = requireStruct(eventRouted.value(), "test envelope"); assertThat(valueStruct.getString("eventType")).isEqualTo("UserUpdated"); assertThat(valueStruct.getString("aggregateType")).isEqualTo("UserEmail"); assertThat(valueStruct.getInt32("eventVersion")).isEqualTo(1); assertThat(valueStruct.getBoolean("someBoolType")).isEqualTo(true); } }
39.980952
114
0.640662
1e6902a4059aef22a13f0b1633fb727be5d3111c
6,490
package com.vladmihalcea.book.hpjp.hibernate.fetching; import com.vladmihalcea.book.hpjp.util.AbstractPostgreSQLIntegrationTest; import com.vladmihalcea.book.hpjp.util.providers.Database; import org.hibernate.jpa.QueryHints; import org.junit.Test; import javax.persistence.*; import java.time.LocalDate; import java.util.ArrayList; import java.util.List; import java.util.stream.Collectors; /** * @author Vlad Mihalcea */ public class DistinctTest extends AbstractPostgreSQLIntegrationTest { @Override protected Class<?>[] entities() { return new Class<?>[]{ Post.class, PostComment.class, }; } @Override protected Database database() { return Database.POSTGRESQL; } @Override public void afterInit() { doInJPA(entityManager -> { entityManager.persist( new Post() .setId(1L) .setTitle("High-Performance Java Persistence eBook has been released!") .setCreatedOn(LocalDate.of(2016, 8, 30)) .addComment(new PostComment("Excellent!")) .addComment(new PostComment("Great!")) ); entityManager.persist( new Post() .setId(2L) .setTitle("High-Performance Java Persistence paperback has been released!") .setCreatedOn(LocalDate.of(2016, 10, 12)) ); entityManager.persist( new Post() .setId(3L) .setTitle("High-Performance Java Persistence Mach 1 video course has been released!") .setCreatedOn(LocalDate.of(2018, 1, 30)) ); entityManager.persist( new Post() .setId(4L) .setTitle("High-Performance Java Persistence Mach 2 video course has been released!") .setCreatedOn(LocalDate.of(2018, 5, 8)) ); }); } @Test public void testWithDistinctScalarQuery() { doInJPA(entityManager -> { List<Integer> publicationYears = entityManager.createQuery(""" select distinct year(p.createdOn) from Post p order by year(p.createdOn) """, Integer.class) .getResultList(); LOGGER.info("Publication years: {}", publicationYears); }); } @Test public void testWithoutDistinct() { doInJPA(entityManager -> { List<Post> posts = entityManager.createQuery(""" select p from Post p left join fetch p.comments where p.title = :title """, Post.class) .setParameter("title", "High-Performance Java Persistence eBook has been released!") .getResultList(); LOGGER.info("Fetched the following Post entity identifiers: {}", posts.stream().map(Post::getId).collect(Collectors.toList())); }); } @Test public void testWithDistinct() { doInJPA(entityManager -> { List<Post> posts = entityManager.createQuery(""" select distinct p from Post p left join fetch p.comments where p.title = :title """, Post.class) .setParameter("title", "High-Performance Java Persistence eBook has been released!") .getResultList(); LOGGER.info("Fetched the following Post entity identifiers: {}", posts.stream().map(Post::getId).collect(Collectors.toList())); }); } @Test public void testWithDistinctAndQueryHint() { doInJPA(entityManager -> { List<Post> posts = entityManager.createQuery(""" select distinct p from Post p left join fetch p.comments where p.title = :title """, Post.class) .setParameter("title", "High-Performance Java Persistence eBook has been released!") .setHint(QueryHints.HINT_PASS_DISTINCT_THROUGH, false) .getResultList(); LOGGER.info("Fetched the following Post entity identifiers: {}", posts.stream().map(Post::getId).collect(Collectors.toList())); }); } @Entity(name = "Post") @Table(name = "post") public static class Post { @Id private Long id; private String title; @Column(name = "created_on") private LocalDate createdOn; @OneToMany( mappedBy = "post", cascade = CascadeType.ALL, orphanRemoval = true ) private List<PostComment> comments = new ArrayList<>(); public Long getId() { return id; } public Post setId(Long id) { this.id = id; return this; } public String getTitle() { return title; } public Post setTitle(String title) { this.title = title; return this; } public LocalDate getCreatedOn() { return createdOn; } public Post setCreatedOn(LocalDate createdOn) { this.createdOn = createdOn; return this; } public Post addComment(PostComment comment) { comments.add(comment); comment.setPost(this); return this; } } @Entity(name = "PostComment") @Table(name = "post_comment") public static class PostComment { @Id @GeneratedValue private Long id; @ManyToOne(fetch = FetchType.LAZY) private Post post; private String review; public PostComment() {} public PostComment(String review) { this.review = review; } public Long getId() { return id; } public PostComment setId(Long id) { this.id = id; return this; } public Post getPost() { return post; } public PostComment setPost(Post post) { this.post = post; return this; } public String getReview() { return review; } public PostComment setReview(String review) { this.review = review; return this; } } }
28.217391
139
0.538059
bc55d8be60bd435a604e90ea57be5d3293131816
3,084
package boot.model; import javax.validation.constraints.NotNull; import javax.validation.constraints.Positive; import java.util.Objects; /**Класс для хранения данных об интернет-баннере. @author Артемьев Р.А. @version 13.09.2019 */ public class Banner { /*Аннотация @NotNull указывает на обязательность параметра. Следует использовать с ссылочными типами. Если же мы нарушим хотя бы одно условие, то в ответ получим json с детальным описанием ошибки. Статус ответа будет не 200, а 400 (Bad Request).*/ @NotNull private Integer bannerId; @NotNull private String imgSrc; @NotNull @Positive private Integer width; /*Аннотация @Positive указывает, что число должно быть положительным*/ @NotNull @Positive private Integer height; @NotNull private String targetUrl; @NotNull private String langId; public Banner(Integer bannerId, String imgSrc, Integer width, Integer height, String targetUrl, String langId) { this.bannerId = bannerId; this.imgSrc = imgSrc; this.width = width; this.height = height; this.targetUrl = targetUrl; this.langId = langId; } public Integer getBannerId() { return bannerId; } public void setBannerId(Integer bannerId) { this.bannerId = bannerId; } public String getImgSrc() { return imgSrc; } public void setImgSrc(String imgSrc) { this.imgSrc = imgSrc; } public Integer getWidth() { return width; } public void setWidth(Integer width) { this.width = width; } public Integer getHeight() { return height; } public void setHeight(Integer height) { this.height = height; } public String getTargetUrl() { return targetUrl; } public void setTargetUrl(String targetUrl) { this.targetUrl = targetUrl; } public String getLangId() { return langId; } public void setLangId(String langId) { this.langId = langId; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Banner banner = (Banner) o; return bannerId.equals(banner.bannerId) && imgSrc.equals(banner.imgSrc) && width.equals(banner.width) && height.equals(banner.height) && targetUrl.equals(banner.targetUrl) && langId.equals(banner.langId); } @Override public int hashCode() { return Objects.hash(bannerId, imgSrc, width, height, targetUrl, langId); } @Override public String toString() { return "Banner{" + "bannerId=" + bannerId + ", imgSrc='" + imgSrc + '\'' + ", width=" + width + ", height=" + height + ", targetUrl='" + targetUrl + '\'' + ", langId='" + langId + '\'' + '}'; } }
24.283465
84
0.585927
87c0e675c306970766c3fd8e0202575037a6e32e
6,044
package cn.innc11.giftcode; import cn.innc11.giftcode.config.GiftCodesConfig; import cn.innc11.giftcode.config.GiftsConfig; import cn.innc11.giftcode.dt.Codes; import cn.innc11.giftcode.dt.Gift; import cn.innc11.giftcode.form.MainPanel; import cn.innc11.giftcode.form.RedeemCodePanel; import cn.innc11.giftcode.listener.FormResponseListener; import cn.nukkit.Player; import cn.nukkit.command.Command; import cn.nukkit.command.CommandSender; import cn.nukkit.event.Listener; import cn.nukkit.event.player.PlayerToggleSprintEvent; import cn.nukkit.plugin.PluginBase; import cn.nukkit.scheduler.PluginTask; import cn.nukkit.utils.TextFormat; import java.io.File; import java.util.HashMap; import java.util.UUID; public class GiftCodePlugin extends PluginBase implements Listener { public static GiftCodePlugin ins; public HashMap<UUID, Codes> codes = new HashMap<>(); public HashMap<UUID, Gift> gifts = new HashMap<>(); public HashMap<String, String> inputCache = new HashMap<>(); GiftsConfig giftsConfig; GiftCodesConfig giftCodeSetConfig; public String charPool; public void loadConfig() { File giftCodesFile = new File(getDataFolder(), "giftCodes.yml"); File gift_CodesFile = new File(getDataFolder(), "gift-codes.yml"); if(!gift_CodesFile.exists() && giftCodesFile.exists()) { giftCodesFile.renameTo(gift_CodesFile); getLogger().info(TextFormat.colorize("&eUpgrade the giftCode.yml -> gift-codes.yml")); } giftsConfig = new GiftsConfig(); giftCodeSetConfig = new GiftCodesConfig(); loadGiftsConfig(); loadGiftCodesConfig(); getLogger().info(TextFormat.colorize("Loaded Gifts: &e" + gifts.size())); getLogger().info(TextFormat.colorize("Loaded GiftCodeSet: &e" + codes.size())); getConfig().reload(); charPool = getConfig().getString("charPool", "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"); getLogger().info(TextFormat.colorize("Loaded CharPool size: &e" + charPool.length())); } public void saveGiftsConfig() { giftsConfig.save(); } public void loadGiftsConfig() { giftsConfig.reload(); } public void saveGiftCodesConfig() { giftCodeSetConfig.save(); } public void loadGiftCodesConfig() { giftCodeSetConfig.reload(); } void registerEvents() { getServer().getPluginManager().registerEvents(new FormResponseListener(), this); } public void onEnable() { ins = this; saveDefaultConfig(); loadConfig(); registerEvents(); getServer().getPluginManager().registerEvents(this, this); } // @EventHandler public void onPlayerSnake(PlayerToggleSprintEvent e) { if (e.getPlayer().isSprinting()) { e.getPlayer().showFormWindow(new MainPanel()); } } public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { if (sender instanceof Player) { String code = ""; if(args.length>=1) { code = args[0].trim(); } if(!code.isEmpty()) { ((Player) sender).showFormWindow(new RedeemCodePanel((Player) sender, code)); return true; } if (sender.isOp()) { ((Player) sender).showFormWindow(new MainPanel()); } else { ((Player) sender).showFormWindow(new RedeemCodePanel((Player) sender, "")); } } return true; } public Gift getGiftWithUUID(String uuid) { return getGiftWithUUID(UUID.fromString(uuid)); } public Gift getGiftWithUUID(UUID uuid) { return gifts.get(uuid); } public Gift getGiftWithLabel(String lable) { for (Gift gift : gifts.values()) { if (gift.label.equals(lable)) { return gift; } } return null; } public boolean removeGiftWithUUID(String uuid) { return removeGiftWithUUID(UUID.fromString(uuid)); } public boolean removeGiftWithUUID(UUID uuid) { return (gifts.remove(uuid) != null); } public void addGift(Gift gift) { gifts.put(gift.uuid, gift); } public Codes getCodesWithUUID(String uuid) { return getCodesWithUUID(UUID.fromString(uuid)); } public Codes getCodesWithUUID(UUID uuid) { return codes.get(uuid); } public boolean removeCodesWithUUID(String uuid) { return removeCodesWithUUID(UUID.fromString(uuid)); } public boolean removeCodesWithUUID(UUID uuid) { return (codes.remove(uuid) != null); } public Codes getCodesWithGiftCode(String giftCode) { for (Codes codeSet : codes.values()) { if (codeSet.isOneTimeCodes()) { if (codeSet.codes.containsKey(giftCode)) return codeSet; continue; } if (codeSet.publicCode.equals(giftCode)) return codeSet; } return null; } public void addCodes(Codes codeSet) { codes.put(codeSet.uuid, codeSet); } public void sendTitleMessage(Player player, String text, final Runnable task, int delayTick) { player.sendTitle(TextFormat.colorize(text)); player.sendMessage(TextFormat.colorize(text)); getServer().getScheduler().scheduleDelayedTask(new PluginTask<GiftCodePlugin>(this) { public void onRun(int currentTick) { if (task != null) task.run(); } }, delayTick); } public void sendTitleMessage(Player player, String text, final Runnable task) { sendTitleMessage(player, text, task, 60); } }
26.743363
119
0.60953
ec910f49c542412092a160b5e6bc41bd57515cde
388
package fr.simplon.orgamenu.repository; import fr.simplon.orgamenu.models.ERole; import fr.simplon.orgamenu.models.Role; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; import java.util.Optional; @Repository public interface RoleRepository extends JpaRepository<Role, Long> { Optional<Role> findByName(ERole name); }
27.714286
67
0.822165
406236f2080bf0460c78e897804f06994655dc44
479
package com.adioss.bootstrap.config; import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.stereotype.Component; import java.util.List; @Component @ConfigurationProperties(prefix = "cors.allowed") public class CorsAllowedOrigins { private List<String> origins; public List<String> getOrigins() { return origins; } public void setOrigins(List<String> origins) { this.origins = origins; } }
22.809524
75
0.743215
d754b00068d5a53669cc0028967100550b4d4077
261
package net.fabricmc.api; import java.lang.annotation.*; @Retention(RetentionPolicy.CLASS) @Target({ElementType.TYPE, ElementType.METHOD, ElementType.FIELD, ElementType.CONSTRUCTOR, ElementType.PACKAGE}) public @interface Environment { EnvType value(); }
26.1
112
0.789272
c479b970d3fcd37a8d5ce60e609f626c486b9a30
6,922
package cd4017be.rs_ctr2.tileentity; import static cd4017be.lib.network.Sync.ALL; import static cd4017be.lib.part.OrientedPart.port; import static cd4017be.lib.tick.GateUpdater.GATE_UPDATER; import static cd4017be.rs_ctr2.Main.SERVER_CFG; import static net.minecraft.util.Direction.NORTH; import org.apache.commons.lang3.tuple.ImmutablePair; import cd4017be.api.grid.ExtGridPorts; import cd4017be.api.grid.port.*; import cd4017be.lib.block.BlockTE.ITEInteract; import cd4017be.lib.network.Sync; import cd4017be.lib.tick.IGate; import cd4017be.lib.util.Orientation; import cd4017be.rs_ctr2.api.IFrame; import cd4017be.rs_ctr2.api.IFrameOperator; import cd4017be.rs_ctr2.api.IProbeInfo; import cd4017be.rs_ctr2.util.Utils; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.nbt.CompoundNBT; import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntityType; import net.minecraft.util.ActionResultType; import net.minecraft.util.Hand; import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockRayTraceResult; import net.minecraft.util.text.TranslationTextComponent; import net.minecraft.world.server.ServerWorld; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; import net.minecraftforge.common.util.Constants.NBT; /** * @author CD4017BE */ public class FrameController extends Machine implements IFrameOperator, IBlockSupplier, IGate, IProbeInfo, ITEInteract { public final int[] region = new int[9]; public ImmutablePair<BlockPos, ServerWorld> block; @Sync(to = ALL) public int frames, missing; @Sync public int dx, dy, dz; @Sync public boolean active; @Sync(to = ALL) public boolean visible = true; public FrameController(TileEntityType<?> type) { super(type); } @Override public void setHandler(int port, Object handler) {} @Override public Object getHandler(int port) { switch(port) { case 0: return (ISignalReceiver)(v, r) -> update(dx, dx = v); case 1: return (ISignalReceiver)(v, r) -> update(dy, dy = v); case 2: return (ISignalReceiver)(v, r) -> update(dz, dz = v); case 3: return this; default: return null; } } private void update(int old, int val) { if (old == val || active) return; active = true; GATE_UPDATER.add(this); } @Override public boolean evaluate() { active = false; if (unloaded) return false; if (missing < 0) updateFrame(); block: { block = null; if (missing != 0) break block; int by = region[4] + dy; if (by < region[3] || by > region[5]) break block; int bx = region[1], bz = region[7]; switch(orientation()) { default: bx += dx; bz += dz; break; case N12: bx -= dx; bz -= dz; break; case E12: bx += dz; bz -= dx; break; case W12: bx -= dz; bz += dx; break; } if (bx < region[0] || bx > region[2]) break block; if (bz < region[6] || bz > region[8]) break block; block = ImmutablePair.of(new BlockPos(bx, by, bz), (ServerWorld)level); } clientDirty(false); return false; } @Override public ImmutablePair<BlockPos, ServerWorld> getBlock(int rec) { return block; } @Override protected void init(ExtGridPorts ports, Orientation o) { ports.createPort(port(o, 0x03, NORTH, ISignalReceiver.TYPE_ID), false, true); ports.createPort(port(o, 0x02, NORTH, ISignalReceiver.TYPE_ID), false, true); ports.createPort(port(o, 0x01, NORTH, ISignalReceiver.TYPE_ID), false, true); ports.createPort(port(o, 0x00, NORTH, IBlockSupplier.TYPE_ID), false, true); missing |= Integer.MIN_VALUE; update(0, 1); } private void updateFrame() { IFrame frame = originFrame(); if (frame == null) { setNullRegion(); return; } frames = frame.findRegion(region); BlockPos pos = worldPosition; missing = frames & ~IFrameOperator.findFrames(level, region, frames, f -> f.addListener(pos)); } private IFrame originFrame() { boolean valid = region[2] > region[0] && region[5] > region[3] && region[8] > region[6]; BlockPos pos = worldPosition; if (valid) { IFrameOperator.findFrames(level, region, frames & ~missing, f -> f.removeListener(pos)); TileEntity te = level.getBlockEntity(new BlockPos(region[1], region[4], region[7])); if (te instanceof IFrame) { return (IFrame)te; } } return IFrameOperator.findNearest(level, pos, SERVER_CFG.device_range.get()); } private void setNullRegion() { region[0] = region[1] = region[2] = worldPosition.getX(); region[3] = region[4] = region[5] = worldPosition.getY(); region[6] = region[7] = region[8] = worldPosition.getZ(); frames = 0; missing = -1; } @Override public void onFrameChange(IFrame frame) { if (frame.exists() ^ missing != 0) return; missing |= Integer.MIN_VALUE; update(0, 1); } @Override public void storeState(CompoundNBT nbt, int mode) { nbt.putIntArray("region", region); if (block != null) nbt.putLong("block", block.left.asLong()); super.storeState(nbt, mode); } @Override public void loadState(CompoundNBT nbt, int mode) { int[] arr = nbt.getIntArray("region"); System.arraycopy(arr, 0, region, 0, Math.min(9, arr.length)); block = nbt.contains("block", NBT.TAG_LONG) ? ImmutablePair.of(BlockPos.of(nbt.getLong("block")), null) : null; super.loadState(nbt, mode); } @Override public void onLoad() { if (level instanceof ServerWorld && block != null) block = ImmutablePair.of(block.left, (ServerWorld)level); if (active && !level.isClientSide) GATE_UPDATER.add(this); super.onLoad(); } @Override public Object[] stateInfo() { int x0, x1, z0, z1; switch(orientation()) { default: x0 = 0; x1 = 2; z0 = 6; z1 = 8; break; case N12: x0 = 2; x1 = 0; z0 = 8; z1 = 6; break; case E12: x0 = 8; x1 = 6; z0 = 0; z1 = 2; break; case W12: x0 = 6; x1 = 8; z0 = 2; z1 = 0; break; } int x = region[x0 + x1 >> 1], z = region[z0 + z1 >> 1]; x0 = region[x0] - x; x1 = region[x1] - x; if (x0 > x1) {x0 = -x0; x1 = -x1;} z0 = region[z0] - z; z1 = region[z1] - z; if (z0 > z1) {z0 = -z0; z1 = -z1;} int y = region[4]; return new Object[] { "state.rs_ctr2.frame_controller", dx, x0, x1, dy, region[3] - y, region[5] - y, dz, z0, z1, IBlockSupplier.toString(this) }; } @Override @OnlyIn(Dist.CLIENT) public AxisAlignedBB getRenderBoundingBox() { return new AxisAlignedBB( region[0], region[3], region[6], region[2]+1, region[5]+1, region[8]+1 ); } @Override public ActionResultType onActivated(PlayerEntity player, Hand hand, BlockRayTraceResult hit) { return player.getItemInHand(hand).isEmpty() ? Utils.serverAction(player, ()-> { visible = !visible; clientDirty(false); player.displayClientMessage(new TranslationTextComponent( visible ? "msg.rs_ctr2.visible" : "msg.rs_ctr2.invisible" ), true); }) : ActionResultType.PASS; } @Override public void onClicked(PlayerEntity player) {} }
30.359649
96
0.689541
13a9ecfcbec0c0bda6b599037e2c5a5f2f2e6209
1,359
package org.springlearning.aop.beanNameAutoProxyCreator; import java.util.Date; import org.springframework.beans.factory.BeanFactory; import org.springframework.beans.factory.support.DefaultListableBeanFactory; import org.springframework.beans.factory.xml.XmlBeanDefinitionReader; import org.springframework.context.ApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext; import org.springframework.core.io.ClassPathResource; public class LaunchApplyTranscationUsingBeanNameAutoProxyCreator { public static void main(String[] args) { try (ClassPathXmlApplicationContext ac = new ClassPathXmlApplicationContext( new String[]{"org/springlearning/aop/beanNameAutoProxyCreator/applicationContext.xml"}); ) { try { //被beanNameAutoProxyCreator代理后实际类型已经不再是BillServiceImpl], //but was actually of type [com.sun.proxy.$Proxy4] // BillService billService = ac.getBean("billService",BillServiceImpl.class); BillService billService = (BillService)ac.getBean("billService"); billService.saveBill(); System.out.println("OK"); } catch (Exception e) { System.out.println("测试LaunchApplyTranscationUsingBeanNameAutoProxyCreator出现异常"); e.printStackTrace(); } } } }
39.970588
98
0.730684
55fafc900edf5aa8d52626dd72bdf9743cbcb18e
296
// Autogenerated from vk-api-schema. Please don't edit it manually. package com.vk.api.sdk.exceptions; public class ApiOtpValidationNeedException extends ApiException { public ApiOtpValidationNeedException(String message) { super(3303, "Otp app validation needed", message); } }
32.888889
67
0.760135
d5adb713aa7236601f9aa7224b39a9fb447013cb
1,039
package com.github.msafonov.corporate.bot; import com.github.msafonov.corporate.bot.controllers.EntityController; import com.github.msafonov.corporate.bot.entities.AuthorizationCode; import com.github.msafonov.corporate.bot.entities.Employee; public class Authorization { private final EntityController entityController; public Authorization(EntityController entityController) { this.entityController = entityController; } public void register(Employee employee, AuthorizationCode code) { entityController.save(employee); code.setEmployee(employee); entityController.update(code); } public boolean isRegistered(Employee employee) { //Возможна доп логика return employee != null; } public boolean isAdministrator(String chat_id) { ///Будет в AdminProperties return true; } public boolean isFreeCode(AuthorizationCode authorizationCode) { return authorizationCode != null && authorizationCode.getUserId() == null; } }
30.558824
82
0.729548
750a26b5e574191fed4e6e44c247b619b0defb5e
937
/// generated by: genswift.java 'java/lang|java/util|java/sql|java/awt|javax/swing' /// /// interface javax.swing.event.TableModelListener /// package org.swiftjava.javax_swing; @SuppressWarnings("JniMissingFunction") public class TableModelListenerProxy implements javax.swing.event.TableModelListener { // address of proxy object long __swiftObject; TableModelListenerProxy( long __swiftObject ) { this.__swiftObject = __swiftObject; } /// public abstract void javax.swing.event.TableModelListener.tableChanged(javax.swing.event.TableModelEvent) public native void __tableChanged( long __swiftObject, javax.swing.event.TableModelEvent e ); public void tableChanged( javax.swing.event.TableModelEvent e ) { __tableChanged( __swiftObject, e ); } public native void __finalize( long __swiftObject ); public void finalize() { __finalize( __swiftObject ); } }
28.393939
113
0.735326
518b3a2e3aa32ed22631c367674def10c6ba1f62
3,963
package com.yunbao.live.custom; import android.content.Context; import android.content.res.TypedArray; import android.graphics.Canvas; import android.graphics.Paint; import android.graphics.Rect; import android.support.annotation.Nullable; import android.util.AttributeSet; import android.view.View; import com.yunbao.live.R; /** * Created by cxf on 2018/11/17. */ public class PkProgressBar extends View { private Paint mPaint1; private Paint mPaint2; private Paint mPaintStroke1; private Paint mPaintStroke2; private int mMinWidth; private float mRate; private int mLeftColor; private int mRightColor; private int mLeftStrokeColor; private int mRightStrokeColor; private Rect mRect1; private Rect mRect2; private int mWidth; private float mScale; public PkProgressBar(Context context) { this(context, null); } public PkProgressBar(Context context, @Nullable AttributeSet attrs) { this(context, attrs, 0); } public PkProgressBar(Context context, @Nullable AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); mScale = context.getResources().getDisplayMetrics().density; TypedArray ta = context.obtainStyledAttributes(attrs, R.styleable.PkProgressBar); mMinWidth = (int) ta.getDimension(R.styleable.PkProgressBar_ppb_minWidth, 0); mRate = ta.getFloat(R.styleable.PkProgressBar_ppb_rate, 0.5f); mLeftColor = ta.getColor(R.styleable.PkProgressBar_ppb_left_color, 0); mRightColor = ta.getColor(R.styleable.PkProgressBar_ppb_right_color, 0); mLeftStrokeColor = ta.getColor(R.styleable.PkProgressBar_ppb_left_color_stroke, 0); mRightStrokeColor = ta.getColor(R.styleable.PkProgressBar_ppb_right_color_stroke, 0); ta.recycle(); init(); } private int dp2px(int dpVal) { return (int) (dpVal * mScale + 0.5f); } private void init() { mPaint1 = new Paint(); mPaint1.setAntiAlias(true); mPaint1.setDither(true); mPaint1.setStyle(Paint.Style.FILL); mPaint1.setColor(mLeftColor); mPaintStroke1 = new Paint(); mPaintStroke1.setAntiAlias(true); mPaintStroke1.setDither(true); mPaintStroke1.setStyle(Paint.Style.STROKE); mPaintStroke1.setStrokeWidth(dp2px(1)); mPaintStroke1.setColor(mLeftStrokeColor); mPaint2 = new Paint(); mPaint2.setAntiAlias(true); mPaint2.setDither(true); mPaint2.setStyle(Paint.Style.FILL); mPaint2.setColor(mRightColor); mPaintStroke2 = new Paint(); mPaintStroke2.setAntiAlias(true); mPaintStroke2.setDither(true); mPaintStroke2.setStyle(Paint.Style.STROKE); mPaintStroke2.setStrokeWidth(dp2px(1)); mPaintStroke2.setColor(mRightStrokeColor); mRect1 = new Rect(); mRect2 = new Rect(); } @Override protected void onSizeChanged(int w, int h, int oldw, int oldh) { mWidth = w; mRect1.left = 0; mRect1.top = 0; mRect1.bottom = h; mRect2.top = 0; mRect2.right = w; mRect2.bottom = h; changeProgress(); } @Override protected void onDraw(Canvas canvas) { canvas.drawRect(mRect1, mPaint1); canvas.drawRect(mRect1, mPaintStroke1); canvas.drawRect(mRect2, mPaint2); canvas.drawRect(mRect2, mPaintStroke2); } public void setProgress(float rate) { if (mRate == rate) { return; } mRate = rate; changeProgress(); invalidate(); } private void changeProgress() { int bound = (int) (mWidth * mRate); if (bound < mMinWidth) { bound = mMinWidth; } if (bound > mWidth - mMinWidth) { bound = mWidth - mMinWidth; } mRect1.right = bound; mRect2.left = bound; } }
29.139706
93
0.646985
6297c7c52d8822ed68c474ee5e87275bcb6bf0bb
20,985
/* * Copyright (c) 2012 ZES Inc. All rights reserved. * This software is the confidential and proprietary information of ZES Inc. * You shall not disclose such Confidential Information and shall use it * only in accordance with the terms of the license agreement you entered into * with ZES Inc. (http://www.zesinc.co.kr/) */ package zes.openworks.web.bid; import java.util.List; import zes.base.vo.FileVO; import zes.base.vo.PaggingVO; /** * @version 1.0 * @since openworks-1.0 프로젝트. (After JDK 1.6) * @author (주)제스아이엔씨 기술연구소 * * <pre> * << 개정이력(Modification Information) >> * * 수정일 수정자 수정내용 * -------------- -------- ------------------------------- * 2014. 10. 22. 이슬버미 신규 * </pre> * @see */ public class TcnBidNotifyVO extends PaggingVO { /** */ private static final long serialVersionUID = 1L; /** 공고번호 */ private String notifyNum; /** 공고차수 */ private int notifySeq; /** 입찰종류여부 */ private String bidGbnCd; /** 서비스구분 */ private String goodKndCd; /** 수요자ID */ private String userId; /** 구매희망목록 순번 */ private String grpSeq; /** 공고종류 */ private String bidKndCd; /** 공고분류 */ private String bidClassCd; /** 계약방법 */ private String cntrMothod; /** 수의계약사유첨부-첨부파일 */ private int optlCntrFile; /** 수의계약사유첨부-첨부파일 */ private List<FileVO> optlCntrFileList; /** 수의계약사유첨부-첨부파일ID(임시저장시 기존 등록되어 있는 파일을 구분하기 위해) */ private String optlCntrFileId; /** 실수요기관 */ private String realDmndOrgn; /** 수요자명 */ private String userNm; /** 담당자명 */ private String goodsChargerNm; /** 직책 */ private String userPosition; /** 대표전화 */ private String goodsChargerCttpc; /** 대표전화1 */ private String goodsChargerCttpc1; /** 대표전화2 */ private String goodsChargerCttpc2; /** 대표전화3 */ private String goodsChargerCttpc3; /** 연계기관공고URL */ private String linkOrgnUrl; /** 입찰공고명 */ private String bidNotifyNm; /** 접수일시 */ private String strtDt; /** 접수시간 */ private String strtTime; /** 마감일시 */ private String clseDt; /** 마감시간 */ private String clseTime; /** 개찰일시 */ private String openDt; /** 개찰시간 */ private String openTime; /** 지역제한1 */ private String areaLimit1; /** 지역제한2 */ private String areaLimit2; /** 지역제한3 */ private String areaLimit3; /** 자격제한-중소기업 */ private String catyLimitEntr; /** 자격제한-벤처기업 */ private String catyLimitVntr; /** 자격제한-사회적기업 */ private String catyLimitSoc; /** 자격제한-여성기업 */ private String catyLimitWomn; /** 자격제한-장애인 */ private String catyLimitDiad; /** 자격제한-기타 */ private String catyLimitEtc; /** 자격제한-기타(입력용) */ private String catyLimitEtcComt; /** 희망구매가 */ private String hopePuchAmt; /** vat여부 */ private String vatGbn; /** 납품일자 */ private String delyDt; /** 납품시간 */ private String delyTime; /** 합의여부 */ private String talkGbn; /** 응답완료일 */ private String rplyDt; /** 납품장소 */ private String delyPlac; /** 납품-첨부파일 */ private int delyFile; /** 납품-첨부파일 */ private List<FileVO> delyFileList; /** 납품-첨부파일ID(임시저장시 기존 등록되어 있는 파일을 구분하기 위해) */ private String delyFileId; /** 공고설명 */ private String notifyCont; /** 상품코드 */ private String goodsCd; /** * String notifyNum을 반환 * @return String notifyNum */ public String getNotifyNum() { return notifyNum; } /** * notifyNum을 설정 * @param notifyNum 을(를) String notifyNum로 설정 */ public void setNotifyNum(String notifyNum) { this.notifyNum = notifyNum; } /** * int notifySeq을 반환 * @return int notifySeq */ public int getNotifySeq() { return notifySeq; } /** * notifySeq을 설정 * @param notifySeq 을(를) int notifySeq로 설정 */ public void setNotifySeq(int notifySeq) { this.notifySeq = notifySeq; } /** * String bidGbnCd을 반환 * @return String bidGbnCd */ public String getBidGbnCd() { return bidGbnCd; } /** * bidGbnCd을 설정 * @param bidGbnCd 을(를) String bidGbnCd로 설정 */ public void setBidGbnCd(String bidGbnCd) { this.bidGbnCd = bidGbnCd; } /** * String goodKndCd을 반환 * @return String goodKndCd */ public String getGoodKndCd() { return goodKndCd; } /** * goodKndCd을 설정 * @param goodKndCd 을(를) String goodKndCd로 설정 */ public void setGoodKndCd(String goodKndCd) { this.goodKndCd = goodKndCd; } /** * String userId을 반환 * @return String userId */ public String getUserId() { return userId; } /** * userId을 설정 * @param userId 을(를) String userId로 설정 */ public void setUserId(String userId) { this.userId = userId; } /** * String grpSeq을 반환 * @return String grpSeq */ public String getGrpSeq() { return grpSeq; } /** * grpSeq을 설정 * @param grpSeq 을(를) String grpSeq로 설정 */ public void setGrpSeq(String grpSeq) { this.grpSeq = grpSeq; } /** * String bidKndCd을 반환 * @return String bidKndCd */ public String getBidKndCd() { return bidKndCd; } /** * bidKndCd을 설정 * @param bidKndCd 을(를) String bidKndCd로 설정 */ public void setBidKndCd(String bidKndCd) { this.bidKndCd = bidKndCd; } /** * String bidClassCd을 반환 * @return String bidClassCd */ public String getBidClassCd() { return bidClassCd; } /** * bidClassCd을 설정 * @param bidClassCd 을(를) String bidClassCd로 설정 */ public void setBidClassCd(String bidClassCd) { this.bidClassCd = bidClassCd; } /** * String cntrMothod을 반환 * @return String cntrMothod */ public String getCntrMothod() { return cntrMothod; } /** * cntrMothod을 설정 * @param cntrMothod 을(를) String cntrMothod로 설정 */ public void setCntrMothod(String cntrMothod) { this.cntrMothod = cntrMothod; } /** * int optlCntrFile을 반환 * @return int optlCntrFile */ public int getOptlCntrFile() { return optlCntrFile; } /** * optlCntrFile을 설정 * @param optlCntrFile 을(를) int optlCntrFile로 설정 */ public void setOptlCntrFile(int optlCntrFile) { this.optlCntrFile = optlCntrFile; } /** * List<FileVO> optlCntrFileList을 반환 * @return List<FileVO> optlCntrFileList */ public List<FileVO> getOptlCntrFileList() { return optlCntrFileList; } /** * optlCntrFileList을 설정 * @param optlCntrFileList 을(를) List<FileVO> optlCntrFileList로 설정 */ public void setOptlCntrFileList(List<FileVO> optlCntrFileList) { this.optlCntrFileList = optlCntrFileList; } /** * String optlCntrFileId을 반환 * @return String optlCntrFileId */ public String getOptlCntrFileId() { return optlCntrFileId; } /** * optlCntrFileId을 설정 * @param optlCntrFileId 을(를) String optlCntrFileId로 설정 */ public void setOptlCntrFileId(String optlCntrFileId) { this.optlCntrFileId = optlCntrFileId; } /** * String realDmndOrgn을 반환 * @return String realDmndOrgn */ public String getRealDmndOrgn() { return realDmndOrgn; } /** * realDmndOrgn을 설정 * @param realDmndOrgn 을(를) String realDmndOrgn로 설정 */ public void setRealDmndOrgn(String realDmndOrgn) { this.realDmndOrgn = realDmndOrgn; } /** * String userNm을 반환 * @return String userNm */ public String getUserNm() { return userNm; } /** * userNm을 설정 * @param userNm 을(를) String userNm로 설정 */ public void setUserNm(String userNm) { this.userNm = userNm; } /** * String goodsChargerNm을 반환 * @return String goodsChargerNm */ public String getGoodsChargerNm() { return goodsChargerNm; } /** * goodsChargerNm을 설정 * @param goodsChargerNm 을(를) String goodsChargerNm로 설정 */ public void setGoodsChargerNm(String goodsChargerNm) { this.goodsChargerNm = goodsChargerNm; } /** * String userPosition을 반환 * @return String userPosition */ public String getUserPosition() { return userPosition; } /** * userPosition을 설정 * @param userPosition 을(를) String userPosition로 설정 */ public void setUserPosition(String userPosition) { this.userPosition = userPosition; } /** * String goodsChargerCttpc을 반환 * @return String goodsChargerCttpc */ public String getGoodsChargerCttpc() { return goodsChargerCttpc; } /** * goodsChargerCttpc을 설정 * @param goodsChargerCttpc 을(를) String goodsChargerCttpc로 설정 */ public void setGoodsChargerCttpc(String goodsChargerCttpc) { this.goodsChargerCttpc = goodsChargerCttpc; } /** * String goodsChargerCttpc1을 반환 * @return String goodsChargerCttpc1 */ public String getGoodsChargerCttpc1() { return goodsChargerCttpc1; } /** * goodsChargerCttpc1을 설정 * @param goodsChargerCttpc1 을(를) String goodsChargerCttpc1로 설정 */ public void setGoodsChargerCttpc1(String goodsChargerCttpc1) { this.goodsChargerCttpc1 = goodsChargerCttpc1; } /** * String goodsChargerCttpc2을 반환 * @return String goodsChargerCttpc2 */ public String getGoodsChargerCttpc2() { return goodsChargerCttpc2; } /** * goodsChargerCttpc2을 설정 * @param goodsChargerCttpc2 을(를) String goodsChargerCttpc2로 설정 */ public void setGoodsChargerCttpc2(String goodsChargerCttpc2) { this.goodsChargerCttpc2 = goodsChargerCttpc2; } /** * String goodsChargerCttpc3을 반환 * @return String goodsChargerCttpc3 */ public String getGoodsChargerCttpc3() { return goodsChargerCttpc3; } /** * goodsChargerCttpc3을 설정 * @param goodsChargerCttpc3 을(를) String goodsChargerCttpc3로 설정 */ public void setGoodsChargerCttpc3(String goodsChargerCttpc3) { this.goodsChargerCttpc3 = goodsChargerCttpc3; } /** * String linkOrgnUrl을 반환 * @return String linkOrgnUrl */ public String getLinkOrgnUrl() { return linkOrgnUrl; } /** * linkOrgnUrl을 설정 * @param linkOrgnUrl 을(를) String linkOrgnUrl로 설정 */ public void setLinkOrgnUrl(String linkOrgnUrl) { this.linkOrgnUrl = linkOrgnUrl; } /** * String bidNotifyNm을 반환 * @return String bidNotifyNm */ public String getBidNotifyNm() { return bidNotifyNm; } /** * bidNotifyNm을 설정 * @param bidNotifyNm 을(를) String bidNotifyNm로 설정 */ public void setBidNotifyNm(String bidNotifyNm) { this.bidNotifyNm = bidNotifyNm; } /** * String strtDt을 반환 * @return String strtDt */ public String getStrtDt() { return strtDt; } /** * strtDt을 설정 * @param strtDt 을(를) String strtDt로 설정 */ public void setStrtDt(String strtDt) { this.strtDt = strtDt; } /** * String strtTime을 반환 * @return String strtTime */ public String getStrtTime() { return strtTime; } /** * strtTime을 설정 * @param strtTime 을(를) String strtTime로 설정 */ public void setStrtTime(String strtTime) { this.strtTime = strtTime; } /** * String clseDt을 반환 * @return String clseDt */ public String getClseDt() { return clseDt; } /** * String goodsCd을 반환 * @return String goodsCd */ public String getGoodsCd() { return goodsCd; } /** * clseDt을 설정 * @param clseDt 을(를) String clseDt로 설정 */ public void setClseDt(String clseDt) { this.clseDt = clseDt; } /** * String clseTime을 반환 * @return String clseTime */ public String getClseTime() { return clseTime; } /** * clseTime을 설정 * @param clseTime 을(를) String clseTime로 설정 */ public void setClseTime(String clseTime) { this.clseTime = clseTime; } /** * String openDt을 반환 * @return String openDt */ public String getOpenDt() { return openDt; } /** * openDt을 설정 * @param openDt 을(를) String openDt로 설정 */ public void setOpenDt(String openDt) { this.openDt = openDt; } /** * String openTime을 반환 * @return String openTime */ public String getOpenTime() { return openTime; } /** * openTime을 설정 * @param openTime 을(를) String openTime로 설정 */ public void setOpenTime(String openTime) { this.openTime = openTime; } /** * String areaLimit1을 반환 * @return String areaLimit1 */ public String getAreaLimit1() { return areaLimit1; } /** * areaLimit1을 설정 * @param areaLimit1 을(를) String areaLimit1로 설정 */ public void setAreaLimit1(String areaLimit1) { this.areaLimit1 = areaLimit1; } /** * String areaLimit2을 반환 * @return String areaLimit2 */ public String getAreaLimit2() { return areaLimit2; } /** * areaLimit2을 설정 * @param areaLimit2 을(를) String areaLimit2로 설정 */ public void setAreaLimit2(String areaLimit2) { this.areaLimit2 = areaLimit2; } /** * String areaLimit3을 반환 * @return String areaLimit3 */ public String getAreaLimit3() { return areaLimit3; } /** * areaLimit3을 설정 * @param areaLimit3 을(를) String areaLimit3로 설정 */ public void setAreaLimit3(String areaLimit3) { this.areaLimit3 = areaLimit3; } /** * String catyLimitEntr을 반환 * @return String catyLimitEntr */ public String getCatyLimitEntr() { return catyLimitEntr; } /** * catyLimitEntr을 설정 * @param catyLimitEntr 을(를) String catyLimitEntr로 설정 */ public void setCatyLimitEntr(String catyLimitEntr) { this.catyLimitEntr = catyLimitEntr; } /** * String catyLimitVntr을 반환 * @return String catyLimitVntr */ public String getCatyLimitVntr() { return catyLimitVntr; } /** * catyLimitVntr을 설정 * @param catyLimitVntr 을(를) String catyLimitVntr로 설정 */ public void setCatyLimitVntr(String catyLimitVntr) { this.catyLimitVntr = catyLimitVntr; } /** * String catyLimitSoc을 반환 * @return String catyLimitSoc */ public String getCatyLimitSoc() { return catyLimitSoc; } /** * catyLimitSoc을 설정 * @param catyLimitSoc 을(를) String catyLimitSoc로 설정 */ public void setCatyLimitSoc(String catyLimitSoc) { this.catyLimitSoc = catyLimitSoc; } /** * String catyLimitWomn을 반환 * @return String catyLimitWomn */ public String getCatyLimitWomn() { return catyLimitWomn; } /** * catyLimitWomn을 설정 * @param catyLimitWomn 을(를) String catyLimitWomn로 설정 */ public void setCatyLimitWomn(String catyLimitWomn) { this.catyLimitWomn = catyLimitWomn; } /** * String catyLimitDiad을 반환 * @return String catyLimitDiad */ public String getCatyLimitDiad() { return catyLimitDiad; } /** * catyLimitDiad을 설정 * @param catyLimitDiad 을(를) String catyLimitDiad로 설정 */ public void setCatyLimitDiad(String catyLimitDiad) { this.catyLimitDiad = catyLimitDiad; } /** * String catyLimitEtc을 반환 * @return String catyLimitEtc */ public String getCatyLimitEtc() { return catyLimitEtc; } /** * catyLimitEtc을 설정 * @param catyLimitEtc 을(를) String catyLimitEtc로 설정 */ public void setCatyLimitEtc(String catyLimitEtc) { this.catyLimitEtc = catyLimitEtc; } /** * String catyLimitEtcComt을 반환 * @return String catyLimitEtcComt */ public String getCatyLimitEtcComt() { return catyLimitEtcComt; } /** * catyLimitEtcComt을 설정 * @param catyLimitEtcComt 을(를) String catyLimitEtcComt로 설정 */ public void setCatyLimitEtcComt(String catyLimitEtcComt) { this.catyLimitEtcComt = catyLimitEtcComt; } /** * String hopePuchAmt을 반환 * @return String hopePuchAmt */ public String getHopePuchAmt() { return hopePuchAmt; } /** * hopePuchAmt을 설정 * @param hopePuchAmt 을(를) String hopePuchAmt로 설정 */ public void setHopePuchAmt(String hopePuchAmt) { this.hopePuchAmt = hopePuchAmt; } /** * String vatGbn을 반환 * @return String vatGbn */ public String getVatGbn() { return vatGbn; } /** * vatGbn을 설정 * @param vatGbn 을(를) String vatGbn로 설정 */ public void setVatGbn(String vatGbn) { this.vatGbn = vatGbn; } /** * String delyDt을 반환 * @return String delyDt */ public String getDelyDt() { return delyDt; } /** * delyDt을 설정 * @param delyDt 을(를) String delyDt로 설정 */ public void setDelyDt(String delyDt) { this.delyDt = delyDt; } /** * String delyTime을 반환 * @return String delyTime */ public String getDelyTime() { return delyTime; } /** * delyTime을 설정 * @param delyTime 을(를) String delyTime로 설정 */ public void setDelyTime(String delyTime) { this.delyTime = delyTime; } /** * String talkGbn을 반환 * @return String talkGbn */ public String getTalkGbn() { return talkGbn; } /** * talkGbn을 설정 * @param talkGbn 을(를) String talkGbn로 설정 */ public void setTalkGbn(String talkGbn) { this.talkGbn = talkGbn; } /** * String rplyDt을 반환 * @return String rplyDt */ public String getRplyDt() { return rplyDt; } /** * rplyDt을 설정 * @param rplyDt 을(를) String rplyDt로 설정 */ public void setRplyDt(String rplyDt) { this.rplyDt = rplyDt; } /** * String delyPlac을 반환 * @return String delyPlac */ public String getDelyPlac() { return delyPlac; } /** * delyPlac을 설정 * @param delyPlac 을(를) String delyPlac로 설정 */ public void setDelyPlac(String delyPlac) { this.delyPlac = delyPlac; } /** * int delyFile을 반환 * @return int delyFile */ public int getDelyFile() { return delyFile; } /** * delyFile을 설정 * @param delyFile 을(를) int delyFile로 설정 */ public void setDelyFile(int delyFile) { this.delyFile = delyFile; } /** * List<FileVO> delyFileList을 반환 * @return List<FileVO> delyFileList */ public List<FileVO> getDelyFileList() { return delyFileList; } /** * delyFileList을 설정 * @param delyFileList 을(를) List<FileVO> delyFileList로 설정 */ public void setDelyFileList(List<FileVO> delyFileList) { this.delyFileList = delyFileList; } /** * String delyFileId을 반환 * @return String delyFileId */ public String getDelyFileId() { return delyFileId; } /** * delyFileId을 설정 * @param delyFileId 을(를) String delyFileId로 설정 */ public void setDelyFileId(String delyFileId) { this.delyFileId = delyFileId; } /** * String notifyCont을 반환 * @return String notifyCont */ public String getNotifyCont() { return notifyCont; } /** * notifyCont을 설정 * @param notifyCont 을(를) String notifyCont로 설정 */ public void setNotifyCont(String notifyCont) { this.notifyCont = notifyCont; } /** * goodsCd을 설정 * @param goodsCd 을(를) String goodsCd로 설정 */ public void setGoodsCd(String goodsCd) { this.goodsCd = goodsCd; } }
19.358856
78
0.567501
82b5a8ffa8f0dafee78628df34d11c5f72b17c1c
1,309
package com.asimkilic.mongodbhw3.dto.read; import java.math.BigDecimal; import java.util.Date; public class ProductReadDto { private String id; private String name; private BigDecimal price; private Date createDate; private CategoryReadDto category; public ProductReadDto() { } public ProductReadDto(String id, String name, BigDecimal price, Date createDate, CategoryReadDto category) { this.id = id; this.name = name; this.price = price; this.createDate = createDate; this.category = category; } public String getId() { return id; } public void setId(String id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public BigDecimal getPrice() { return price; } public void setPrice(BigDecimal price) { this.price = price; } public Date getCreateDate() { return createDate; } public void setCreateDate(Date createDate) { this.createDate = createDate; } public CategoryReadDto getCategory() { return category; } public void setCategory(CategoryReadDto category) { this.category = category; } }
19.25
112
0.620321
bd80acea5c28be8684fe8c13f310e5631714d75f
14,723
/******************************************************************************* * PathVisio, a tool for data visualization and analysis using biological pathways * Copyright 2006-2021 BiGCaT Bioinformatics, WikiPathways * * Licensed 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. ******************************************************************************/ package org.pathvisio.gui.view; import com.jgoodies.forms.builder.DefaultFormBuilder; import com.jgoodies.forms.layout.FormLayout; import java.awt.BorderLayout; import java.awt.Color; import java.awt.Component; import java.awt.Cursor; import java.awt.Dimension; import java.awt.Font; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.Point; import java.awt.Rectangle; import java.awt.Toolkit; import java.awt.datatransfer.Clipboard; import java.awt.event.KeyEvent; import java.awt.event.KeyListener; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import java.awt.event.MouseListener; import java.awt.event.MouseMotionListener; import java.awt.event.MouseWheelEvent; import java.awt.event.MouseWheelListener; import java.util.HashSet; import java.util.List; import java.util.Set; import javax.swing.Action; import javax.swing.JComponent; import javax.swing.JPanel; import javax.swing.JScrollPane; import javax.swing.JWindow; import javax.swing.KeyStroke; import javax.swing.SwingUtilities; import javax.swing.TransferHandler; import javax.swing.UIManager; import org.pathvisio.gui.core.PathwayTransferable; import org.pathvisio.gui.core.SwingKeyEvent; import org.pathvisio.gui.core.SwingMouseEvent; import org.pathvisio.gui.core.ToolTipProvider; import org.pathvisio.model.PathwayModel; import org.pathvisio.model.PathwayElement; import org.pathvisio.util.preferences.GlobalPreference; import org.pathvisio.util.preferences.PreferenceManager; import org.pathvisio.view.model.VLabel; import org.pathvisio.view.VElementMouseEvent; import org.pathvisio.view.VElementMouseListener; import org.pathvisio.view.model.VPathwayModel; import org.pathvisio.view.model.VElement; import org.pathvisio.view.model.VPathwayEvent; import org.pathvisio.view.model.VPathwayListener; import org.pathvisio.view.model.VPathwayWrapper; import org.pathvisio.view.model.VShapedElement; import org.pathvisio.view.model.Handle; import org.pathvisio.gui.MainPanel; import org.pathvisio.gui.dnd.PathwayImportHandler; /** * swing-dependent implementation of VPathway. */ public class VPathwaySwing extends JPanel implements VPathwayWrapper, MouseMotionListener, MouseListener, KeyListener, VPathwayListener, VElementMouseListener, MouseWheelListener { protected VPathwayModel child; protected JScrollPane container; public VPathwaySwing(JScrollPane parent) { super(); if (parent == null) throw new IllegalArgumentException("parent is null"); this.container = parent; addMouseListener(this); addMouseMotionListener(this); addKeyListener(this); addMouseWheelListener(this); setFocusable(true); setRequestFocusEnabled(true); setTransferHandler(new PathwayImportHandler()); setDoubleBuffered(PreferenceManager.getCurrent().getBoolean(GlobalPreference.ENABLE_DOUBLE_BUFFERING)); } public void setChild(VPathwayModel c) { child = c; child.addVPathwayListener(this); child.addVElementMouseListener(this); } public VPathwayModel getChild() { return child; } public Dimension getViewportSize() { if (container instanceof JScrollPane) { return ((JScrollPane) container).getViewport().getExtentSize(); } return getSize(); } /** * Schedule redraw of the entire visible area */ public void redraw() { repaint(); } /** * Draw immediately */ protected void paintComponent(Graphics g) { if (child != null) child.draw((Graphics2D) g); } /** * Schedule redraw of a certain part of the pathway */ public void redraw(Rectangle r) { repaint(r); } public void mouseClicked(MouseEvent e) { if (e.getClickCount() == 2) { child.mouseDoubleClick(new SwingMouseEvent(e)); } } public void mouseEntered(MouseEvent e) { // requestFocus(); //TODO: test if this is needed in applet. child.mouseEnter(new SwingMouseEvent(e)); } public void mouseExited(MouseEvent e) { child.mouseExit(new SwingMouseEvent(e)); } public void mousePressed(MouseEvent e) { requestFocus(); child.mouseDown(new SwingMouseEvent(e)); } public void mouseReleased(MouseEvent e) { child.mouseUp(new SwingMouseEvent(e)); } public void keyPressed(KeyEvent e) { child.keyPressed(new SwingKeyEvent(e)); } public void keyReleased(KeyEvent e) { child.keyReleased(new SwingKeyEvent(e)); } public void keyTyped(KeyEvent e) { // TODO: find out how to handle this one } public void mouseDragged(MouseEvent e) { Rectangle r = container.getViewport().getViewRect(); final int stepSize = 10; int newx = (int) r.getMinX(); int newy = (int) r.getMinY(); // scroll when dragging out of view if (e.getX() > r.getMaxX()) { newx += stepSize; } if (e.getX() < r.getMinX()) { newx = Math.max(newx - stepSize, 0); } if (e.getY() > r.getMaxY()) { newy += stepSize; } if (e.getY() < r.getMinY()) { newy = Math.max(newy - stepSize, 0); } container.getViewport().setViewPosition(new Point(newx, newy)); child.mouseMove(new SwingMouseEvent(e)); } public void mouseMoved(MouseEvent e) { child.mouseMove(new SwingMouseEvent(e)); } public void mouseWheelMoved(MouseWheelEvent e) { int notches = e.getWheelRotation(); if (notches < 0) { child.zoomToCursor(child.getPctZoom() * 21 / 20, e.getPoint()); } else { child.zoomToCursor(child.getPctZoom() * 20 / 21, e.getPoint()); } Component comp = container.getParent().getParent(); if (comp instanceof MainPanel) ((MainPanel) comp).updateZoomCombo(); } public void registerKeyboardAction(KeyStroke k, Action a) { super.registerKeyboardAction(a, k, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT); // super.registerKeyboardAction(a, k, WHEN_IN_FOCUSED_WINDOW); } public VPathwayModel createVPathway() { setChild(new VPathwayModel(this)); return child; } public void vPathwayEvent(VPathwayEvent e) { switch (e.getType()) { case MODEL_LOADED: if (e.getSource() == child) { SwingUtilities.invokeLater(new Runnable() { public void run() { container.setViewportView(VPathwaySwing.this); resized(); VPathwaySwing.this.requestFocus(); } }); } break; case ELEMENT_HOVER: showToolTip(e); break; } } /** * paste from clip board with the common shift */ public void pasteFromClipboard() { Clipboard clip = Toolkit.getDefaultToolkit().getSystemClipboard(); TransferHandler handler = getTransferHandler(); handler.importData(this, clip.getContents(this)); } /** * paste from clip board at the cursor position */ public void positionPasteFromClipboard(Point cursorPosition) { Clipboard clip = Toolkit.getDefaultToolkit().getSystemClipboard(); PathwayImportHandler handler = (PathwayImportHandler) getTransferHandler(); handler.importDataAtCursorPosition(this, clip.getContents(this), cursorPosition); } List<PathwayElement> lastCopied; public void copyToClipboard(PathwayModel source, List<PathwayElement> copyElements) { Clipboard clip = Toolkit.getDefaultToolkit().getSystemClipboard(); clip.setContents(new PathwayTransferable(source, copyElements), (PathwayImportHandler) getTransferHandler()); ((PathwayImportHandler) getTransferHandler()).obtainedOwnership(); } Set<ToolTipProvider> toolTipProviders = new HashSet<ToolTipProvider>(); public void addToolTipProvider(ToolTipProvider p) { toolTipProviders.add(p); } public void showToolTip(final VPathwayEvent e) { if (toolTipProviders.size() == 0) return; SwingUtilities.invokeLater(new Runnable() { public void run() { List<VElement> elements = e.getAffectedElements(); if (elements.size() > 0) { PathwayToolTip tip = new PathwayToolTip(elements); if (!tip.hasContent()) return; final JWindow w = new JWindow(); w.setLayout(new BorderLayout()); w.add(tip, BorderLayout.CENTER); Point p = e.getMouseEvent().getLocation(); SwingUtilities.convertPointToScreen(p, VPathwaySwing.this); w.setLocation(p); // For some reason the mouse listener only works when // adding it directly to the scrollpane (the first child component). tip.getComponent(0).addMouseListener(new MouseAdapter() { public void mouseExited(MouseEvent e) { // Don't dispose if on scrollbars if (e.getComponent().contains(e.getPoint())) return; // Don't dispose if mouse is down (usually when scrolling) if ((e.getModifiersEx() & MouseEvent.BUTTON1_DOWN_MASK) != 0) return; w.dispose(); } }); w.setVisible(true); w.pack(); } } }); } class PathwayToolTip extends JPanel { private boolean hasContent; public PathwayToolTip(List<VElement> elements) { applyToolTipStyle(this); setLayout(new BorderLayout()); DefaultFormBuilder builder = new DefaultFormBuilder(new FormLayout("pref")); for (ToolTipProvider p : toolTipProviders) { Component c = p.createToolTipComponent(this, elements); if (c != null) { hasContent = true; builder.append(c); builder.nextLine(); } } JPanel contents = builder.getPanel(); applyToolTipStyle(contents); JScrollPane scroll = new JScrollPane(contents, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); int w = contents.getPreferredSize().width + scroll.getVerticalScrollBar().getPreferredSize().width + 5; int h = contents.getPreferredSize().height + scroll.getHorizontalScrollBar().getPreferredSize().height + 5; w = Math.min(400, w); h = Math.min(500, h); setPreferredSize(new Dimension(w, h)); add(scroll, BorderLayout.CENTER); } public boolean hasContent() { return hasContent; } } /** * Apply the tooltip style (e.g. colors) to the given component. */ public static void applyToolTipStyle(JComponent c) { c.setForeground((Color) UIManager.get("ToolTip.foreground")); c.setBackground((Color) UIManager.get("ToolTip.background")); c.setFont((Font) UIManager.get("ToolTip.font")); } public void scrollTo(Rectangle r) { container.getViewport().scrollRectToVisible(r); } public void vElementMouseEvent(VElementMouseEvent e) { // Change mouse cursor based on underlying object if (e.getElement() instanceof Handle) { if (e.getType() == VElementMouseEvent.TYPE_MOUSEENTER) { Handle h = (Handle) e.getElement(); if (h.getAngle() == 1) setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); else setCursor(Cursor.getPredefinedCursor(calculateCursorStyle(e))); } else if (e.getType() == VElementMouseEvent.TYPE_MOUSEEXIT) { setCursor(Cursor.getDefaultCursor()); } } else if (e.getElement() instanceof VLabel) { if (e.getType() == VElementMouseEvent.TYPE_MOUSE_SHOWHAND) { setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); } else if (e.getType() == VElementMouseEvent.TYPE_MOUSE_NOTSHOWHAND) { setCursor(Cursor.getDefaultCursor()); } } } /** * calculates the corresponding cursor type depending on the angle of the * current handle object and the rotation of the object * * @param e * @return */ private int calculateCursorStyle(VElementMouseEvent e) { Handle h = (Handle) e.getElement(); if (h.getParent() instanceof VShapedElement) { VShapedElement gs = (VShapedElement) h.getParent(); double rotation = gs.getPathwayElement().getRotation(); double degrees = h.getAngle() + (rotation * (180 / Math.PI)); if (degrees > 360) degrees = degrees - 360; if (h.getAngle() == 1) { return Cursor.MOVE_CURSOR; } else { switch (h.getFreedom()) { case X: return getXYCursorPosition(degrees); case Y: return getXYCursorPosition(degrees); case FREE: return getFREECursorPosition(degrees); case NEGFREE: return getFREECursorPosition(degrees); } } } return Cursor.DEFAULT_CURSOR; } private int getXYCursorPosition(double degrees) { if (degrees < 45 || degrees > 315) { return Cursor.E_RESIZE_CURSOR; } else if (degrees < 135) { return Cursor.S_RESIZE_CURSOR; } else if (degrees < 225) { return Cursor.W_RESIZE_CURSOR; } else if (degrees < 315) { return Cursor.N_RESIZE_CURSOR; } return Cursor.DEFAULT_CURSOR; } private int getFREECursorPosition(double degrees) { if (degrees < 90) { return Cursor.SE_RESIZE_CURSOR; } else if (degrees < 180) { return Cursor.SW_RESIZE_CURSOR; } else if (degrees < 270) { return Cursor.NW_RESIZE_CURSOR; } else if (degrees <= 360) { return Cursor.NE_RESIZE_CURSOR; } return Cursor.DEFAULT_CURSOR; } private boolean disposed = false; public void dispose() { assert (!disposed); if (container != null && container instanceof JScrollPane) ((JScrollPane) container).remove(this); child.removeVPathwayListener(this); child.removeVElementMouseListener(this); removeMouseListener(this); removeMouseMotionListener(this); removeKeyListener(this); setTransferHandler(null); // clean up actions, inputs registered earlier for this component // (otherwise VPathway won't get GC'ed, because actions contain reference to // VPathay) getActionMap().clear(); getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).clear(); child = null; // free VPathway for GC disposed = true; } private int oldVWidth = 0; private int oldVHeight = 0; public void resized() { int vw = (int) child.getVWidth(); int vh = (int) child.getVHeight(); if (vw != oldVWidth || vh != oldVHeight) { oldVWidth = vw; oldVHeight = vh; setPreferredSize(new Dimension(vw, vh)); revalidate(); repaint(); } } public Rectangle getViewRect() { return container.getViewport().getViewRect(); } public void scrollCenterTo(int x, int y) { int w = container.getViewport().getWidth(); int h = container.getViewport().getHeight(); Rectangle r = new Rectangle(x - (w / 2), y - (h / 2), w - 1, h - 1); scrollRectToVisible(r); } }
29.039448
118
0.7148
b042f674d7f2bf5168392ed60c9282bfc7829a67
6,107
package org.benf.cfr.reader.bytecode.analysis.parse.statement; import org.benf.cfr.reader.bytecode.analysis.loc.BytecodeLoc; import org.benf.cfr.reader.bytecode.analysis.parse.utils.Pair; import org.benf.cfr.reader.bytecode.analysis.opgraph.Op04StructuredStatement; import org.benf.cfr.reader.bytecode.analysis.parse.Expression; import org.benf.cfr.reader.bytecode.analysis.parse.Statement; import org.benf.cfr.reader.bytecode.analysis.parse.expression.ConditionalExpression; import org.benf.cfr.reader.bytecode.analysis.parse.rewriters.ExpressionRewriter; import org.benf.cfr.reader.bytecode.analysis.parse.rewriters.ExpressionRewriterFlags; import org.benf.cfr.reader.bytecode.analysis.parse.utils.*; import org.benf.cfr.reader.bytecode.analysis.structured.StructuredStatement; import org.benf.cfr.reader.bytecode.analysis.structured.statement.*; import org.benf.cfr.reader.entities.exceptions.ExceptionCheck; import org.benf.cfr.reader.util.output.Dumper; public class IfStatement extends GotoStatement { private static final int JUMP_NOT_TAKEN = 0; private static final int JUMP_TAKEN = 1; private ConditionalExpression condition; private BlockIdentifier knownIfBlock = null; private BlockIdentifier knownElseBlock = null; public IfStatement(BytecodeLoc loc, ConditionalExpression conditionalExpression) { super(loc); this.condition = conditionalExpression; } @Override public BytecodeLoc getCombinedLoc() { return BytecodeLoc.combine(this, condition); } @Override public Dumper dump(Dumper dumper) { dumper.print("if").print(" ").separator("(").dump(condition).separator(")").print(" "); return super.dump(dumper); } @Override public void replaceSingleUsageLValues(LValueRewriter lValueRewriter, SSAIdentifiers ssaIdentifiers) { Expression replacementCondition = condition.replaceSingleUsageLValues(lValueRewriter, ssaIdentifiers, getContainer()); if (replacementCondition != condition) { this.condition = (ConditionalExpression) replacementCondition; } } @Override public void rewriteExpressions(ExpressionRewriter expressionRewriter, SSAIdentifiers ssaIdentifiers) { condition = expressionRewriter.rewriteExpression(condition, ssaIdentifiers, getContainer(), ExpressionRewriterFlags.RVALUE); } @Override public void collectLValueUsage(LValueUsageCollector lValueUsageCollector) { condition.collectUsedLValues(lValueUsageCollector); } public ConditionalExpression getCondition() { return condition; } public void setCondition(ConditionalExpression condition) { this.condition = condition; } public void simplifyCondition() { condition = ConditionalUtils.simplify(condition); } public void negateCondition() { condition = ConditionalUtils.simplify(condition.getNegated()); } public void replaceWithWhileLoopStart(BlockIdentifier blockIdentifier) { WhileStatement replacement = new WhileStatement(getLoc(), ConditionalUtils.simplify(condition.getNegated()), blockIdentifier); getContainer().replaceStatement(replacement); } public void replaceWithWhileLoopEnd(BlockIdentifier blockIdentifier) { WhileStatement replacement = new WhileStatement(getLoc(), ConditionalUtils.simplify(condition), blockIdentifier); getContainer().replaceStatement(replacement); } @Override public Statement getJumpTarget() { return getTargetStatement(JUMP_TAKEN); } @Override public boolean isConditional() { return true; } @Override public boolean canThrow(ExceptionCheck caught) { return condition.canThrow(caught); } @Override public StructuredStatement getStructuredStatement() { switch (getJumpType()) { case GOTO: case GOTO_OUT_OF_IF: case GOTO_OUT_OF_TRY: return new UnstructuredIf(getLoc(), condition, knownIfBlock, knownElseBlock); case CONTINUE: return new StructuredIf(getLoc(), condition, new Op04StructuredStatement(new UnstructuredContinue(getLoc(), getTargetStartBlock()))); case BREAK: return new StructuredIf(getLoc(), condition, new Op04StructuredStatement(new UnstructuredBreak(getLoc(), getJumpTarget().getContainer().getBlocksEnded()))); case BREAK_ANONYMOUS: { Statement target = getJumpTarget(); if (!(target instanceof AnonBreakTarget)) { throw new IllegalStateException("Target of anonymous break unexpected."); } AnonBreakTarget anonBreakTarget = (AnonBreakTarget) target; BlockIdentifier breakFrom = anonBreakTarget.getBlockIdentifier(); Op04StructuredStatement unstructuredBreak = new Op04StructuredStatement(new UnstructuredAnonymousBreak(getLoc(), breakFrom)); return new StructuredIf(getLoc(), condition, unstructuredBreak); } } throw new UnsupportedOperationException("Unexpected jump type in if block - " + getJumpType()); } public void setKnownBlocks(BlockIdentifier ifBlock, BlockIdentifier elseBlock) { this.knownIfBlock = ifBlock; this.knownElseBlock = elseBlock; } public Pair<BlockIdentifier, BlockIdentifier> getBlocks() { return Pair.make(knownIfBlock, knownElseBlock); } public BlockIdentifier getKnownIfBlock() { return knownIfBlock; } public boolean hasElseBlock() { return knownElseBlock != null; } public void optimiseForTypes() { condition = condition.optimiseForType(); } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; IfStatement that = (IfStatement) o; if (condition != null ? !condition.equals(that.condition) : that.condition != null) return false; return true; } }
37.697531
172
0.70804
89f7a5a642680eee0df83395b535c4151b3b0ed9
5,295
// =================================================================================================== // _ __ _ _ // | |/ /__ _| | |_ _ _ _ _ __ _ // | ' </ _` | | _| || | '_/ _` | // |_|\_\__,_|_|\__|\_,_|_| \__,_| // // This file is part of the Kaltura Collaborative Media Suite which allows users // to do with audio, video, and animation what Wiki platfroms allow them to do with // text. // // Copyright (C) 2006-2018 Kaltura Inc. // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as // published by the Free Software Foundation, either version 3 of the // License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Affero General Public License for more details. // // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. // // @ignore // =================================================================================================== package com.kaltura.client.services; import com.kaltura.client.types.DeliveryProfile; import com.kaltura.client.types.DeliveryProfileFilter; import com.kaltura.client.types.FilterPager; import com.kaltura.client.utils.request.ListResponseRequestBuilder; import com.kaltura.client.utils.request.RequestBuilder; /** * This class was generated using exec.php * against an XML schema provided by Kaltura. * * MANUAL CHANGES TO THIS CLASS WILL BE OVERWRITTEN. */ /** * delivery service is used to control delivery objects * * @param delivery * @param deliveryId * @param id * @param filter * @param pager * @param id * @param delivery */ public class DeliveryProfileService { public static class AddDeliveryProfileBuilder extends RequestBuilder<DeliveryProfile, DeliveryProfile.Tokenizer, AddDeliveryProfileBuilder> { public AddDeliveryProfileBuilder(DeliveryProfile delivery) { super(DeliveryProfile.class, "deliveryprofile", "add"); params.add("delivery", delivery); } } /** * Add new delivery. * * @param delivery */ public static AddDeliveryProfileBuilder add(DeliveryProfile delivery) { return new AddDeliveryProfileBuilder(delivery); } public static class CloneDeliveryProfileBuilder extends RequestBuilder<DeliveryProfile, DeliveryProfile.Tokenizer, CloneDeliveryProfileBuilder> { public CloneDeliveryProfileBuilder(int deliveryId) { super(DeliveryProfile.class, "deliveryprofile", "clone"); params.add("deliveryId", deliveryId); } public void deliveryId(String multirequestToken) { params.add("deliveryId", multirequestToken); } } /** * Add delivery based on existing delivery. Must provide valid sourceDeliveryId * * @param deliveryId */ public static CloneDeliveryProfileBuilder clone(int deliveryId) { return new CloneDeliveryProfileBuilder(deliveryId); } public static class GetDeliveryProfileBuilder extends RequestBuilder<DeliveryProfile, DeliveryProfile.Tokenizer, GetDeliveryProfileBuilder> { public GetDeliveryProfileBuilder(String id) { super(DeliveryProfile.class, "deliveryprofile", "get"); params.add("id", id); } public void id(String multirequestToken) { params.add("id", multirequestToken); } } /** * Get delivery by id * * @param id */ public static GetDeliveryProfileBuilder get(String id) { return new GetDeliveryProfileBuilder(id); } public static class ListDeliveryProfileBuilder extends ListResponseRequestBuilder<DeliveryProfile, DeliveryProfile.Tokenizer, ListDeliveryProfileBuilder> { public ListDeliveryProfileBuilder(DeliveryProfileFilter filter, FilterPager pager) { super(DeliveryProfile.class, "deliveryprofile", "list"); params.add("filter", filter); params.add("pager", pager); } } public static ListDeliveryProfileBuilder list() { return list(null); } public static ListDeliveryProfileBuilder list(DeliveryProfileFilter filter) { return list(filter, null); } /** * Retrieve a list of available delivery depends on the filter given * * @param filter * @param pager */ public static ListDeliveryProfileBuilder list(DeliveryProfileFilter filter, FilterPager pager) { return new ListDeliveryProfileBuilder(filter, pager); } public static class UpdateDeliveryProfileBuilder extends RequestBuilder<DeliveryProfile, DeliveryProfile.Tokenizer, UpdateDeliveryProfileBuilder> { public UpdateDeliveryProfileBuilder(String id, DeliveryProfile delivery) { super(DeliveryProfile.class, "deliveryprofile", "update"); params.add("id", id); params.add("delivery", delivery); } public void id(String multirequestToken) { params.add("id", multirequestToken); } } /** * Update exisiting delivery * * @param id * @param delivery */ public static UpdateDeliveryProfileBuilder update(String id, DeliveryProfile delivery) { return new UpdateDeliveryProfileBuilder(id, delivery); } }
32.090909
156
0.69594
2c5ef44e945dbc331fdf6919e17d884ed414f2f7
2,936
package mvm.rya.indexing.external.tupleSet; /* * 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. */ import info.aduna.iteration.CloseableIteration; import java.util.HashMap; import java.util.HashSet; import java.util.Map; import java.util.Set; import org.openrdf.query.BindingSet; import org.openrdf.query.QueryEvaluationException; import org.openrdf.query.algebra.Projection; import org.openrdf.query.algebra.QueryModelVisitor; import com.google.common.base.Joiner; import com.google.common.collect.Sets; /** * This a testing class to create mock pre-computed join nodes in order to * test the {@link PrecompJoinOptimizer} for query planning. * */ public class SimpleExternalTupleSet extends ExternalTupleSet { public SimpleExternalTupleSet(Projection tuple) { this.setProjectionExpr(tuple); setSupportedVarOrders(); } private void setSupportedVarOrders() { final Set<String> varSet = Sets.newHashSet(); final Map<String, Set<String>> supportedVarOrders = new HashMap<>(); String t = ""; for (final String s : this.getTupleExpr().getAssuredBindingNames()) { if (t.length() == 0) { t = s; } else { t = t + VAR_ORDER_DELIM + s; } varSet.add(s); supportedVarOrders.put(t, new HashSet<String>(varSet)); } this.setSupportedVariableOrderMap(supportedVarOrders); } @Override public <X extends Exception> void visit(QueryModelVisitor<X> visitor) throws X { visitor.meetOther(this); } @Override public CloseableIteration<BindingSet, QueryEvaluationException> evaluate( BindingSet bindings) throws QueryEvaluationException { // TODO Auto-generated method stub return null; } @Override public String getSignature() { return "(SimpleExternalTupleSet) " + Joiner.on(", ") .join(this.getTupleExpr().getProjectionElemList() .getElements()).replaceAll("\\s+", " "); } @Override public boolean equals(Object other) { if (!(other instanceof SimpleExternalTupleSet)) { return false; } else { final SimpleExternalTupleSet arg = (SimpleExternalTupleSet) other; if (this.getTupleExpr().equals(arg.getTupleExpr())) { return true; } else { return false; } } } }
26.45045
75
0.730586
8883035bad9571ceaa26bc054da3a9dfc3e8f54e
7,539
/* @testcase definitions for introduced type test cases --- initial variants // -------- error "can't emit cast for NotFoundType() to PrimitiveType(int) //double i = (double) i2() - i1(); //int i = (int) this.someInt(); // -------- compiler RuntimeException: "Unsupported emit on NotFoundType" Type.java:460 //double j = (double) (d2() - d1()); //if ((d2() - d1()) instanceof float) { doTrue(); } //if ((d2() - d1()) instanceof int) { doTrue(); } //if ((d2() - d1()) instanceof short) { doTrue(); } //if ((d2() - d1()) instanceof double) { doTrue(); } //if ((i2() - i1()) instanceof int) { doTrue(); } //if (!((getBoolean()) instanceof boolean)) { Tester.check(false,"boolean"); } //if (!((getChar()) instanceof char)) { Tester.check(false,"char"); } //if (!((getByte()) instanceof byte)) { Tester.check(false,"byte"); } if (d2 instanceof double) { doTrue(); } // ------ expecting error, get compiler RuntimeException if (!((doVoid()) instanceof Void)) { Tester.check(false,"void"); } // -------- NPE NewInstanceExpr.java:287 //InnerClass i = this.new InnerClass(); //InnerClass i = getThis().new InnerClass(); --- generalization of initial variants primitive type not found: either the introduced-on type or the method type of it --- possibly-relevant variants [failingTypeExpressions: instanceof, cast, qualified-new] x [introduced|normal|subclass] x [static|{default}] x [methods|field initializers] x [types=[String|Object|Type]|primitiveTypes=[boolean|...]] --- actual variants [failingTypeExpressions] x [introduced|subclass] x [methods|field initializers] x [primitiveTypes] except cast expression only for introduced methods - uncertain here */ class Type {} public class TargetClass { TargetClass getThis() { return this ; } boolean getboolean() { return (this != null); } byte getbyte() { return '\1'; } char getchar() { return '\1'; } short getshort() { return 0; } int getint() { return 0; } long getlong() { return 1l; } float getfloat() { return 1f; } double getdouble() { return 1d; } String getstring() { return ""; } void doVoid() { } Type getType() { return null; } /** run PUREJAVA variant of the tests */ public static void main(String[] args) { PureJava me = new PureJava(); me.run(); if (!me.result_cast) Util.fail("me.result_cast"); if (!me.result_inner) Util.fail("me.result_inner"); } public class InnerClass { public boolean valid() { return (null != this); } } } /** PUREJAVA variant of the tests */ class PureJava extends TargetClass { public void run() { instanceOf(); cast(); newInner(); } public void newInner() { InnerClass i = this.new InnerClass(); if (!i.valid()) Util.fail("this.new InnerClass()"); InnerClass j = getThis().new InnerClass(); if (!j.valid()) Util.fail("getThis().new InnerClass()"); Util.signal("inner"); } public void cast() { boolean boolean_1 = getboolean(); boolean boolean_2 = (boolean) getboolean(); boolean boolean_3 = (boolean) this.getboolean(); byte byte_1 = getbyte(); byte byte_2 = (byte) getbyte(); byte byte_3 = (byte) this.getbyte(); char char_1 = getchar(); char char_2 = (char) getchar(); char char_3 = (char) this.getchar(); short short_1 = getshort(); short short_2 = (short) getshort(); short short_3 = (short) this.getshort(); int int_1 = getint(); int int_2 = (int) getint(); int int_3 = (int) this.getint(); long long_1 = getlong(); long long_2 = (long) getlong(); long long_3 = (long) this.getlong(); float float_1 = getfloat(); float float_2 = (float) getfloat(); float float_3 = (float) this.getfloat(); double double_1 = getdouble(); double double_2 = (double) getdouble(); double double_3 = (double) this.getdouble(); //X X_1 = getX(); //X X_2 = (X) getX(); //X X_3 = (X) this.getX(); Util.signal("cast"); } public void instanceOf() { // -------- RuntimeException: "Unsupported emit on NotFoundType" Type.java:460 /* if (!((getBoolean()) instanceof Boolean)) { Util.fail("boolean"); } if (!((getChar()) instanceof char)) { Util.fail("char"); } if (!((getByte()) instanceof byte)) { Util.fail("byte"); } if (!((getShort()) instanceof short)) { Util.fail("short"); } if (!((getInt()) instanceof int)) { Util.fail("int"); } if (!((getLong()) instanceof long)) { Util.fail("long"); } if (!((getFloat()) instanceof float)) { Util.fail("float"); } if (!((getDouble()) instanceof double)) { Util.fail("double"); } */ // ------ todo: expecting error, get RuntimeException //if (!((doVoid()) instanceof Void)) { Tester.check(false,"void"); } Util.signal("instanceOf"); } // ---------- field initializer interface Result { public boolean run();} boolean result_inner = new Result() { public boolean run() { TargetClass.InnerClass i = ((TargetClass) PureJava.this).new InnerClass(); if (!i.valid()) Util.fail("this.new InnerClass()"); TargetClass.InnerClass j = ((TargetClass) getThis()).new InnerClass(); if (!j.valid()) Util.fail("getThis().new InnerClass()"); Util.signal("innerfield"); return i.valid() && j.valid(); } }.run(); boolean result_cast = new Result() { public boolean run() { boolean boolean_1 = getboolean(); boolean boolean_2 = (boolean) getboolean(); boolean boolean_3 = (boolean) PureJava.this.getboolean(); byte byte_1 = getbyte(); byte byte_2 = (byte) getbyte(); byte byte_3 = (byte) PureJava.this.getbyte(); char char_1 = getchar(); char char_2 = (char) getchar(); char char_3 = (char) PureJava.this.getchar(); short short_1 = getshort(); short short_2 = (short) getshort(); short short_3 = (short) PureJava.this.getshort(); int int_1 = getint(); int int_2 = (int) getint(); int int_3 = (int) PureJava.this.getint(); long long_1 = getlong(); long long_2 = (long) getlong(); long long_3 = (long) PureJava.this.getlong(); float float_1 = getfloat(); float float_2 = (float) getfloat(); float float_3 = (float) PureJava.this.getfloat(); double double_1 = getdouble(); double double_2 = (double) getdouble(); double double_3 = (double) PureJava.this.getdouble(); //X X_1 = getX(); //X X_2 = (X) getX(); //X X_3 = (X) this.getX(); Util.signal("castfield"); return (boolean_1 && boolean_2 && boolean_3); } }.run(); }
39.678947
94
0.534686
2d3a60b0c8229bb83ed6869a11788d8f437fcae4
1,340
package de.andipopp.poodle.views.editpoll.date; import java.time.LocalDateTime; import java.util.Date; import com.vaadin.flow.data.binder.Result; import com.vaadin.flow.data.binder.ValueContext; import com.vaadin.flow.data.converter.Converter; import com.vaadin.flow.data.converter.LocalDateTimeToDateConverter; /** * A wrapper for {@link LocalDateTimeToDateConverter} which uses variable time zones from a {@link DateOptionFormList}. * @author Andi Popp * */ public class VariableLocalDateTimeToDateConverter implements Converter<LocalDateTime, Date> { /** * The list to take the time zone from */ final DateOptionFormList list; /** * Construct a new converter for the given list * @param list value for {@link #list} */ public VariableLocalDateTimeToDateConverter(DateOptionFormList list) { this.list = list; } @Override public Result<Date> convertToModel(LocalDateTime value, ValueContext context) { LocalDateTimeToDateConverter converter = new LocalDateTimeToDateConverter(list.getTimezone()); return converter.convertToModel(value, context); } @Override public LocalDateTime convertToPresentation(Date value, ValueContext context) { LocalDateTimeToDateConverter converter = new LocalDateTimeToDateConverter(list.getTimezone()); return converter.convertToPresentation(value, context); } }
29.777778
119
0.786567
8e5993e494d21e093eae77e8bb3e6aef5f02b822
3,975
package org.nnsoft.guice.autobind.utils; import java.util.StringTokenizer; import javax.inject.Inject; import org.nnsoft.guice.autobind.jsr330.Names; import com.google.inject.AbstractModule; import com.google.inject.Guice; import com.google.inject.Injector; import com.google.inject.Key; public class VariableResolver { /** * The symbol that indicates a variable begin. */ private static final String VAR_BEGIN = "$"; /** * The symbol that separates the key name to the default value. */ private static final String PIPE_SEPARATOR = "|"; private static final String KEY_PREFIX = "${"; /** * The Injector instance used to resolve variables. */ @Inject private Injector injector; public String resolve(final String pattern) { StringBuilder buffer = new StringBuilder(); int prev = 0; int pos; while ((pos = pattern.indexOf(VAR_BEGIN, prev)) >= 0) { if (pos > 0) { buffer.append(pattern.substring(prev, pos)); } if (pos == pattern.length() - 1) { buffer.append(VAR_BEGIN); prev = pos + 1; } else if (pattern.charAt(pos + 1) != '{') { if (pattern.charAt(pos + 1) == '$') { buffer.append(VAR_BEGIN); prev = pos + 2; } else { buffer.append(pattern.substring(pos, pos + 2)); prev = pos + 2; } } else { int endName = pattern.indexOf('}', pos); if (endName < 0) { throw new IllegalArgumentException("Syntax error in property: " + pattern); } StringTokenizer keyTokenizer = new StringTokenizer(pattern.substring(pos + 2, endName), PIPE_SEPARATOR); String key = keyTokenizer.nextToken().trim(); String defaultValue = null; if (keyTokenizer.hasMoreTokens()) { defaultValue = keyTokenizer.nextToken().trim(); } try { buffer.append(injector.getInstance(Key.get(String.class, Names.named(key)))); } catch (Throwable e) { if (defaultValue != null) { buffer.append(defaultValue); } else { buffer.append(KEY_PREFIX).append(key).append('}'); } } prev = endName + 1; } } if (prev < pattern.length()) { buffer.append(pattern.substring(prev)); } return buffer.toString(); } public static void main(String[] args) { Injector injector = Guice.createInjector(new AbstractModule() { @Override protected void configure() { bindConstant().annotatedWith(Names.named("variable.1")).to("feuer"); bindConstant().annotatedWith(Names.named("variable.2")).to("frei"); bindConstant().annotatedWith(Names.named("config.soap.protocol")).to("ftp"); bindConstant().annotatedWith(Names.named("config.soap.ip")).to("1.1.1.1"); bindConstant().annotatedWith(Names.named("config.soap.port")).to("9999"); bindConstant().annotatedWith(Names.named("config.soap.app")).to("dynmaic"); bindConstant().annotatedWith(Names.named("config.soap.client")).to("/henkel"); bindConstant().annotatedWith(Names.named("config.soap.stage")).to("test"); } }); VariableResolver resolver = injector.getInstance(VariableResolver.class); System.out.println(resolver.resolve("${variable.1} ${variable.2}")); System.out.println(resolver.resolve("\"${variable.3| }\"")); System.out.println(resolver.resolve("${config.soap.protocol|http}://${config.soap.ip|127.0.0.1}:${config.soap.port|12400}/${config.soap.app|configuration}${config.soap.client| }/soap/optional.xml?stage=${config.soap.stage|default}")); } }
36.46789
236
0.574843
d703afd0554958c0adde78319ea1e584fed990af
22,921
// // このファイルは、JavaTM Architecture for XML Binding(JAXB) Reference Implementation、v2.2.8-b130911.1802によって生成されました // <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>を参照してください // ソース・スキーマの再コンパイル時にこのファイルの変更は失われます。 // 生成日: 2019.07.23 時間 02:14:31 PM JST // package jp.go.kishou.xml.jmaxml1.body.meteorology1; import java.util.ArrayList; import java.util.List; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlList; import javax.xml.bind.annotation.XmlSchemaType; import javax.xml.bind.annotation.XmlType; import jp.go.kishou.xml.jmaxml1.elementbasis1.TypeCircle; import jp.go.kishou.xml.jmaxml1.elementbasis1.TypeCoordinate; /** * <p>type.Area complex typeのJavaクラス。 * * <p>次のスキーマ・フラグメントは、このクラス内に含まれる予期されるコンテンツを指定します。 * * <pre> * &lt;complexType name="type.Area"> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="Name" type="{http://www.w3.org/2001/XMLSchema}string"/> * &lt;element name="Code" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> * &lt;element name="Prefecture" type="{http://xml.kishou.go.jp/jmaxml1/body/meteorology1/}type.PrefectureCity" minOccurs="0"/> * &lt;element name="PrefectureCode" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> * &lt;element name="PrefectureList" type="{http://xml.kishou.go.jp/jmaxml1/body/meteorology1/}list.type.Area.PrefectureList" minOccurs="0"/> * &lt;element name="PrefectureCodeList" type="{http://xml.kishou.go.jp/jmaxml1/body/meteorology1/}list.type.Area.PrefectureCodeList" minOccurs="0"/> * &lt;element name="SubPrefecture" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> * &lt;element name="SubPrefectureCode" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> * &lt;element name="SubPrefectureList" type="{http://xml.kishou.go.jp/jmaxml1/body/meteorology1/}list.type.Area.SubPrefectureList" minOccurs="0"/> * &lt;element name="SubPrefectureCodeList" type="{http://xml.kishou.go.jp/jmaxml1/body/meteorology1/}list.type.Area.SubPrefectureCodeList" minOccurs="0"/> * &lt;element name="City" type="{http://xml.kishou.go.jp/jmaxml1/body/meteorology1/}type.PrefectureCity" minOccurs="0"/> * &lt;element name="CityCode" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> * &lt;element name="CityList" type="{http://xml.kishou.go.jp/jmaxml1/body/meteorology1/}list.type.Area.CityList" minOccurs="0"/> * &lt;element name="CityCodeList" type="{http://xml.kishou.go.jp/jmaxml1/body/meteorology1/}list.type.Area.CityCodeList" minOccurs="0"/> * &lt;element name="SubCity" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> * &lt;element name="SubCityCode" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> * &lt;element name="SubCityList" type="{http://xml.kishou.go.jp/jmaxml1/body/meteorology1/}list.type.Area.SubCityList" minOccurs="0"/> * &lt;element name="SubCityCodeList" type="{http://xml.kishou.go.jp/jmaxml1/body/meteorology1/}list.type.Area.SubCityCodeList" minOccurs="0"/> * &lt;element ref="{http://xml.kishou.go.jp/jmaxml1/elementBasis1/}Circle" maxOccurs="unbounded" minOccurs="0"/> * &lt;element ref="{http://xml.kishou.go.jp/jmaxml1/elementBasis1/}Coordinate" maxOccurs="unbounded" minOccurs="0"/> * &lt;element ref="{http://xml.kishou.go.jp/jmaxml1/elementBasis1/}Line" maxOccurs="unbounded" minOccurs="0"/> * &lt;element ref="{http://xml.kishou.go.jp/jmaxml1/elementBasis1/}Polygon" maxOccurs="unbounded" minOccurs="0"/> * &lt;element name="Location" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> * &lt;element name="Status" type="{http://xml.kishou.go.jp/jmaxml1/body/meteorology1/}enum.type.Area.Status" minOccurs="0"/> * &lt;/sequence> * &lt;attribute name="codeType" type="{http://www.w3.org/2001/XMLSchema}string" /> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "type.Area", propOrder = { "name", "code", "prefecture", "prefectureCode", "prefectureList", "prefectureCodeList", "subPrefecture", "subPrefectureCode", "subPrefectureList", "subPrefectureCodeList", "city", "cityCode", "cityList", "cityCodeList", "subCity", "subCityCode", "subCityList", "subCityCodeList", "circle", "coordinate", "line", "polygon", "location", "status" }) public class TypeArea { @XmlElement(name = "Name", required = true) protected String name; @XmlElement(name = "Code") protected String code; @XmlElement(name = "Prefecture") protected TypePrefectureCity prefecture; @XmlElement(name = "PrefectureCode") protected String prefectureCode; @XmlList @XmlElement(name = "PrefectureList") protected List<String> prefectureList; @XmlList @XmlElement(name = "PrefectureCodeList") protected List<String> prefectureCodeList; @XmlElement(name = "SubPrefecture") protected String subPrefecture; @XmlElement(name = "SubPrefectureCode") protected String subPrefectureCode; @XmlList @XmlElement(name = "SubPrefectureList") protected List<String> subPrefectureList; @XmlList @XmlElement(name = "SubPrefectureCodeList") protected List<String> subPrefectureCodeList; @XmlElement(name = "City") protected TypePrefectureCity city; @XmlElement(name = "CityCode") protected String cityCode; @XmlList @XmlElement(name = "CityList") protected List<String> cityList; @XmlList @XmlElement(name = "CityCodeList") protected List<String> cityCodeList; @XmlElement(name = "SubCity") protected String subCity; @XmlElement(name = "SubCityCode") protected String subCityCode; @XmlList @XmlElement(name = "SubCityList") protected List<String> subCityList; @XmlList @XmlElement(name = "SubCityCodeList") protected List<String> subCityCodeList; @XmlElement(name = "Circle", namespace = "http://xml.kishou.go.jp/jmaxml1/elementBasis1/") protected List<TypeCircle> circle; @XmlElement(name = "Coordinate", namespace = "http://xml.kishou.go.jp/jmaxml1/elementBasis1/") protected List<TypeCoordinate> coordinate; @XmlElement(name = "Line", namespace = "http://xml.kishou.go.jp/jmaxml1/elementBasis1/") protected List<TypeCoordinate> line; @XmlElement(name = "Polygon", namespace = "http://xml.kishou.go.jp/jmaxml1/elementBasis1/") protected List<TypeCoordinate> polygon; @XmlElement(name = "Location") protected String location; @XmlElement(name = "Status") @XmlSchemaType(name = "string") protected EnumTypeAreaStatus status; @XmlAttribute(name = "codeType") protected String codeType; /** * nameプロパティの値を取得します。 * * @return * possible object is * {@link String } * */ public String getName() { return name; } /** * nameプロパティの値を設定します。 * * @param value * allowed object is * {@link String } * */ public void setName(String value) { this.name = value; } /** * codeプロパティの値を取得します。 * * @return * possible object is * {@link String } * */ public String getCode() { return code; } /** * codeプロパティの値を設定します。 * * @param value * allowed object is * {@link String } * */ public void setCode(String value) { this.code = value; } /** * prefectureプロパティの値を取得します。 * * @return * possible object is * {@link TypePrefectureCity } * */ public TypePrefectureCity getPrefecture() { return prefecture; } /** * prefectureプロパティの値を設定します。 * * @param value * allowed object is * {@link TypePrefectureCity } * */ public void setPrefecture(TypePrefectureCity value) { this.prefecture = value; } /** * prefectureCodeプロパティの値を取得します。 * * @return * possible object is * {@link String } * */ public String getPrefectureCode() { return prefectureCode; } /** * prefectureCodeプロパティの値を設定します。 * * @param value * allowed object is * {@link String } * */ public void setPrefectureCode(String value) { this.prefectureCode = value; } /** * Gets the value of the prefectureList property. * * <p> * This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the * returned list will be present inside the JAXB object. * This is why there is not a <CODE>set</CODE> method for the prefectureList property. * * <p> * For example, to add a new item, do as follows: * <pre> * getPrefectureList().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link String } * * */ public List<String> getPrefectureList() { if (prefectureList == null) { prefectureList = new ArrayList<String>(); } return this.prefectureList; } /** * Gets the value of the prefectureCodeList property. * * <p> * This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the * returned list will be present inside the JAXB object. * This is why there is not a <CODE>set</CODE> method for the prefectureCodeList property. * * <p> * For example, to add a new item, do as follows: * <pre> * getPrefectureCodeList().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link String } * * */ public List<String> getPrefectureCodeList() { if (prefectureCodeList == null) { prefectureCodeList = new ArrayList<String>(); } return this.prefectureCodeList; } /** * subPrefectureプロパティの値を取得します。 * * @return * possible object is * {@link String } * */ public String getSubPrefecture() { return subPrefecture; } /** * subPrefectureプロパティの値を設定します。 * * @param value * allowed object is * {@link String } * */ public void setSubPrefecture(String value) { this.subPrefecture = value; } /** * subPrefectureCodeプロパティの値を取得します。 * * @return * possible object is * {@link String } * */ public String getSubPrefectureCode() { return subPrefectureCode; } /** * subPrefectureCodeプロパティの値を設定します。 * * @param value * allowed object is * {@link String } * */ public void setSubPrefectureCode(String value) { this.subPrefectureCode = value; } /** * Gets the value of the subPrefectureList property. * * <p> * This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the * returned list will be present inside the JAXB object. * This is why there is not a <CODE>set</CODE> method for the subPrefectureList property. * * <p> * For example, to add a new item, do as follows: * <pre> * getSubPrefectureList().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link String } * * */ public List<String> getSubPrefectureList() { if (subPrefectureList == null) { subPrefectureList = new ArrayList<String>(); } return this.subPrefectureList; } /** * Gets the value of the subPrefectureCodeList property. * * <p> * This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the * returned list will be present inside the JAXB object. * This is why there is not a <CODE>set</CODE> method for the subPrefectureCodeList property. * * <p> * For example, to add a new item, do as follows: * <pre> * getSubPrefectureCodeList().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link String } * * */ public List<String> getSubPrefectureCodeList() { if (subPrefectureCodeList == null) { subPrefectureCodeList = new ArrayList<String>(); } return this.subPrefectureCodeList; } /** * cityプロパティの値を取得します。 * * @return * possible object is * {@link TypePrefectureCity } * */ public TypePrefectureCity getCity() { return city; } /** * cityプロパティの値を設定します。 * * @param value * allowed object is * {@link TypePrefectureCity } * */ public void setCity(TypePrefectureCity value) { this.city = value; } /** * cityCodeプロパティの値を取得します。 * * @return * possible object is * {@link String } * */ public String getCityCode() { return cityCode; } /** * cityCodeプロパティの値を設定します。 * * @param value * allowed object is * {@link String } * */ public void setCityCode(String value) { this.cityCode = value; } /** * Gets the value of the cityList property. * * <p> * This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the * returned list will be present inside the JAXB object. * This is why there is not a <CODE>set</CODE> method for the cityList property. * * <p> * For example, to add a new item, do as follows: * <pre> * getCityList().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link String } * * */ public List<String> getCityList() { if (cityList == null) { cityList = new ArrayList<String>(); } return this.cityList; } /** * Gets the value of the cityCodeList property. * * <p> * This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the * returned list will be present inside the JAXB object. * This is why there is not a <CODE>set</CODE> method for the cityCodeList property. * * <p> * For example, to add a new item, do as follows: * <pre> * getCityCodeList().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link String } * * */ public List<String> getCityCodeList() { if (cityCodeList == null) { cityCodeList = new ArrayList<String>(); } return this.cityCodeList; } /** * subCityプロパティの値を取得します。 * * @return * possible object is * {@link String } * */ public String getSubCity() { return subCity; } /** * subCityプロパティの値を設定します。 * * @param value * allowed object is * {@link String } * */ public void setSubCity(String value) { this.subCity = value; } /** * subCityCodeプロパティの値を取得します。 * * @return * possible object is * {@link String } * */ public String getSubCityCode() { return subCityCode; } /** * subCityCodeプロパティの値を設定します。 * * @param value * allowed object is * {@link String } * */ public void setSubCityCode(String value) { this.subCityCode = value; } /** * Gets the value of the subCityList property. * * <p> * This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the * returned list will be present inside the JAXB object. * This is why there is not a <CODE>set</CODE> method for the subCityList property. * * <p> * For example, to add a new item, do as follows: * <pre> * getSubCityList().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link String } * * */ public List<String> getSubCityList() { if (subCityList == null) { subCityList = new ArrayList<String>(); } return this.subCityList; } /** * Gets the value of the subCityCodeList property. * * <p> * This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the * returned list will be present inside the JAXB object. * This is why there is not a <CODE>set</CODE> method for the subCityCodeList property. * * <p> * For example, to add a new item, do as follows: * <pre> * getSubCityCodeList().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link String } * * */ public List<String> getSubCityCodeList() { if (subCityCodeList == null) { subCityCodeList = new ArrayList<String>(); } return this.subCityCodeList; } /** * Gets the value of the circle property. * * <p> * This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the * returned list will be present inside the JAXB object. * This is why there is not a <CODE>set</CODE> method for the circle property. * * <p> * For example, to add a new item, do as follows: * <pre> * getCircle().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link TypeCircle } * * */ public List<TypeCircle> getCircle() { if (circle == null) { circle = new ArrayList<TypeCircle>(); } return this.circle; } /** * Gets the value of the coordinate property. * * <p> * This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the * returned list will be present inside the JAXB object. * This is why there is not a <CODE>set</CODE> method for the coordinate property. * * <p> * For example, to add a new item, do as follows: * <pre> * getCoordinate().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link TypeCoordinate } * * */ public List<TypeCoordinate> getCoordinate() { if (coordinate == null) { coordinate = new ArrayList<TypeCoordinate>(); } return this.coordinate; } /** * Gets the value of the line property. * * <p> * This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the * returned list will be present inside the JAXB object. * This is why there is not a <CODE>set</CODE> method for the line property. * * <p> * For example, to add a new item, do as follows: * <pre> * getLine().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link TypeCoordinate } * * */ public List<TypeCoordinate> getLine() { if (line == null) { line = new ArrayList<TypeCoordinate>(); } return this.line; } /** * Gets the value of the polygon property. * * <p> * This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the * returned list will be present inside the JAXB object. * This is why there is not a <CODE>set</CODE> method for the polygon property. * * <p> * For example, to add a new item, do as follows: * <pre> * getPolygon().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link TypeCoordinate } * * */ public List<TypeCoordinate> getPolygon() { if (polygon == null) { polygon = new ArrayList<TypeCoordinate>(); } return this.polygon; } /** * locationプロパティの値を取得します。 * * @return * possible object is * {@link String } * */ public String getLocation() { return location; } /** * locationプロパティの値を設定します。 * * @param value * allowed object is * {@link String } * */ public void setLocation(String value) { this.location = value; } /** * statusプロパティの値を取得します。 * * @return * possible object is * {@link EnumTypeAreaStatus } * */ public EnumTypeAreaStatus getStatus() { return status; } /** * statusプロパティの値を設定します。 * * @param value * allowed object is * {@link EnumTypeAreaStatus } * */ public void setStatus(EnumTypeAreaStatus value) { this.status = value; } /** * codeTypeプロパティの値を取得します。 * * @return * possible object is * {@link String } * */ public String getCodeType() { return codeType; } /** * codeTypeプロパティの値を設定します。 * * @param value * allowed object is * {@link String } * */ public void setCodeType(String value) { this.codeType = value; } }
28.05508
163
0.582872
dc641fe5245d178e783504dbdb768a0f2bbcc7f6
6,682
/* * Copyright 2012 Blue Lotus Software, LLC. * Copyright 2012 John Yeary * * Licensed 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. */ /* * $Id$ */ package com.bluelotussoftware.module8.files; import java.io.BufferedOutputStream; import java.io.FileOutputStream; import java.io.IOException; import java.nio.file.FileStore; import java.nio.file.Files; import java.nio.file.LinkOption; import java.nio.file.NoSuchFileException; import java.nio.file.Path; import java.nio.file.Paths; import java.nio.file.StandardCopyOption; import java.nio.file.attribute.FileTime; import java.nio.file.attribute.GroupPrincipal; import java.nio.file.attribute.PosixFileAttributeView; import java.nio.file.attribute.PosixFileAttributes; import java.nio.file.attribute.PosixFilePermission; import java.nio.file.attribute.PosixFilePermissions; import java.util.Map; import java.util.Set; import java.util.concurrent.TimeUnit; /** * * @author John Yeary * @version 1.0 */ public class FilesExamples { public static void main(String... args) throws IOException { Path pxe = Paths.get("target/", "module8-1.0-SNAPSHOT.jar"); if (Files.exists(pxe, LinkOption.NOFOLLOW_LINKS)) { boolean isRegularExecutableFile = Files.isRegularFile(pxe) & Files.isReadable(pxe) & Files.isExecutable(pxe); System.out.println("isRegularExecutableFile: " + isRegularExecutableFile); System.out.println("Files.isRegularFile(pxe, LinkOption.NOFOLLOW_LINKS): " + Files.isRegularFile(pxe, LinkOption.NOFOLLOW_LINKS)); System.out.println("Files.isReadable(pxe): " + Files.isReadable(pxe)); Map<String, Object> attrs = Files.readAttributes(pxe, "*", LinkOption.NOFOLLOW_LINKS); for (String s : attrs.keySet()) { System.out.format("%s : %s%n", s, attrs.get(s)); } Files.copy(pxe, pxe, StandardCopyOption.REPLACE_EXISTING); Files.copy(pxe, Paths.get(pxe.getName(0).toString(), "uber.jar"), StandardCopyOption.REPLACE_EXISTING); System.out.println("pxe exists? " + Files.exists(pxe, LinkOption.NOFOLLOW_LINKS)); System.out.println("pxe lastModifiedTime: " + Files.getLastModifiedTime(pxe).toString()); try { Files.delete(pxe); } catch (NoSuchFileException nsfe) { System.out.println(nsfe.getFile()); System.out.println(nsfe.getMessage()); System.out.println(nsfe.getCause()); System.out.println(nsfe.getReason()); } finally { Files.deleteIfExists(pxe); System.out.println("pxe exists? " + Files.exists(pxe)); } try (BufferedOutputStream buffy = new BufferedOutputStream(new FileOutputStream(pxe.toFile()), 8192)) { Files.copy(Paths.get("target/uber.jar"), buffy); } System.out.println("pxe exists? " + Files.exists(pxe)); Path infection = pxe; Path patient0 = Paths.get("target", "patient0"); Files.move(infection, patient0, StandardCopyOption.ATOMIC_MOVE); PosixFileAttributeView pfv = Files.getFileAttributeView(patient0, PosixFileAttributeView.class, LinkOption.NOFOLLOW_LINKS); Set<PosixFilePermission> permissions = pfv.readAttributes().permissions(); for (PosixFilePermission pfp : permissions) { System.out.println(pfp.name()); } PosixFileAttributes attributes = Files.readAttributes(patient0, PosixFileAttributes.class); System.out.format("%s %s %s%n", attributes.owner().getName(), attributes.group().getName(), PosixFilePermissions.toString(attributes.permissions())); // This group needs to exist on your system. GroupPrincipal group = patient0.getFileSystem().getUserPrincipalLookupService().lookupPrincipalByGroupName("_developer"); System.out.println("Group: " + group.getName()); Files.getFileAttributeView(patient0, PosixFileAttributeView.class).setGroup(group); attributes = Files.readAttributes(patient0, PosixFileAttributes.class); System.out.format("%s %s %s%n", attributes.owner().getName(), attributes.group().getName(), PosixFilePermissions.toString(attributes.permissions())); Files.move(Paths.get("target", "uber.jar"), pxe, StandardCopyOption.REPLACE_EXISTING); //META-DATA System.out.format("Files.size(pxe): %d%n", Files.size(pxe)); System.out.format("Files.isDirectory(pxe, LinkOption.NOFOLLOW_LINKS): %b%n", Files.isDirectory(pxe, LinkOption.NOFOLLOW_LINKS)); System.out.format("Files.isHidden(pxe): %b%n", Files.isHidden(pxe)); Files.copy(pxe, Paths.get("target", ".agent"), StandardCopyOption.REPLACE_EXISTING); System.out.format("Files.isHidden(.agent): %b%n", Files.isHidden(Paths.get("target", ".agent"))); System.out.println("Files.getLastModifiedTime(pxe): " + Files.getLastModifiedTime(pxe)); Files.setLastModifiedTime(pxe, FileTime.from(1L, TimeUnit.NANOSECONDS)); System.out.println("Files.getLastModifiedTime(pxe): " + Files.getLastModifiedTime(pxe)); System.out.format("Files.getOwner(pxe): %s%n", Files.getOwner(pxe)); //File Storage FileStore store = Files.getFileStore(pxe); long totalSpace = store.getTotalSpace() / 1024; long usedSpace = (store.getTotalSpace() - store.getUnallocatedSpace()) / 1024; long usableSpace = store.getUsableSpace() / 1024; System.out.format("FileStore Data (bytes) total: %d used: %d available: %d%n", totalSpace,usedSpace,usableSpace); } else { Path pox = Files.createTempFile("", ""); System.out.println("pox exists? : " + Files.exists(pox)); System.out.println("If you have pox... you need to do a clean build"); } } }
45.767123
140
0.64771
aa535ef06606bc505da60323dfbb6c7d4c9856d1
4,278
/* * 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. */ package org.apache.usergrid.mq.cassandra.io; import java.util.List; import java.util.UUID; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.apache.usergrid.mq.Message; import org.apache.usergrid.mq.QueueQuery; import org.apache.usergrid.mq.QueueResults; import me.prettyprint.hector.api.Keyspace; import static org.apache.usergrid.mq.cassandra.CassandraMQUtils.getConsumerId; import static org.apache.usergrid.mq.cassandra.CassandraMQUtils.getQueueId; /** * Reads from the queue without starting transactions. * * @author tnine */ public class NoTransactionSearch extends AbstractSearch { private static final Logger logger = LoggerFactory.getLogger( NoTransactionSearch.class ); protected static final int DEFAULT_READ = 1; /** * @param ko */ public NoTransactionSearch( Keyspace ko ) { super( ko ); } /* * (non-Javadoc) * * @see org.apache.usergrid.mq.cassandra.io.QueueSearch#getResults(java.lang.String, * org.apache.usergrid.mq.QueueQuery) */ @Override public QueueResults getResults( String queuePath, QueueQuery query ) { UUID queueId = getQueueId( queuePath ); UUID consumerId = getConsumerId( queueId, query ); QueueBounds bounds = getQueueBounds( queueId ); SearchParam params = getParams( queueId, consumerId, query ); List<UUID> ids = getIds( queueId, consumerId, bounds, params ); List<Message> messages = loadMessages( ids, params.reversed ); QueueResults results = createResults( messages, queuePath, queueId, consumerId ); writeClientPointer( queueId, consumerId, results.getLast() ); return results; } /** Get information for reading no transactionally from the query. Subclasses can override this behavior */ protected SearchParam getParams( UUID queueId, UUID consumerId, QueueQuery query ) { UUID lastReadMessageId = getConsumerQueuePosition( queueId, consumerId ); if ( logger.isDebugEnabled() ) { logger.debug( "Last message id is '{}' for queueId '{}' and clientId '{}'", new Object[] { lastReadMessageId, queueId, consumerId } ); } return new SearchParam( lastReadMessageId, false, lastReadMessageId != null, query.getLimit( DEFAULT_READ ) ); } /** Get the list of ids we should load and return to the client. Message ids should be in order on return */ protected List<UUID> getIds( UUID queueId, UUID consumerId, QueueBounds bounds, SearchParam params ) { return getQueueRange( queueId, bounds, params ); } protected static class SearchParam { /** The uuid to start seeking from */ protected final UUID startId; /** true if we should seek from high to low */ protected final boolean reversed; /** The number of results to include */ protected final int limit; /** true if the first result should be skipped. Useful for paging from a previous result */ protected final boolean skipFirst; /** * @param startId * @param reversed * @param count */ public SearchParam( UUID startId, boolean reversed, boolean skipFirst, int count ) { this.startId = startId; this.reversed = reversed; this.skipFirst = skipFirst; this.limit = count; } } }
31.925373
118
0.678121
aa45be231f2ea9578c1c58bbcb9bae16ba5b60c3
1,512
/* * Copyright 2011 Internet Archive * * Licensed 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. */ package org.archive.jbs.lucene; import java.io.*; import java.net.*; import java.util.*; import org.apache.lucene.document.*; import org.apache.lucene.index.*; import org.archive.jbs.Document; import org.archive.jbs.util.*; /** * */ public class NutchWAXSiteHandler implements FieldHandler { public NutchWAXSiteHandler( ) { } public void handle( org.apache.lucene.document.Document doc, Document document ) { try { URL u = new URL( document.get( "url" ) ); String host = IDN.toUnicode( u.getHost(), IDN.ALLOW_UNASSIGNED ); host = host.replaceAll( "^www[0-9]*.", "" ); doc.add( new Field( "site", host, Field.Store.NO, Field.Index.NOT_ANALYZED_NO_NORMS) ); } catch ( MalformedURLException mue ) { // Very strange for the URL of a crawled page to be malformed. // But, in that case, just skip it. } } }
25.627119
95
0.674603
be5776e778386bbb90ac0831c5f4dc65a5942c1e
10,588
begin_unit|revision:0.9.5;language:Java;cregit-version:0.0.1 begin_comment comment|/* * 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. */ end_comment begin_package DECL|package|org.apache.camel.component.salesforce package|package name|org operator|. name|apache operator|. name|camel operator|. name|component operator|. name|salesforce package|; end_package begin_import import|import name|java operator|. name|util operator|. name|Collections import|; end_import begin_import import|import name|java operator|. name|util operator|. name|Map import|; end_import begin_import import|import name|java operator|. name|util operator|. name|Optional import|; end_import begin_import import|import name|org operator|. name|apache operator|. name|camel operator|. name|component operator|. name|extension operator|. name|verifier operator|. name|DefaultComponentVerifierExtension import|; end_import begin_import import|import name|org operator|. name|apache operator|. name|camel operator|. name|component operator|. name|extension operator|. name|verifier operator|. name|NoSuchOptionException import|; end_import begin_import import|import name|org operator|. name|apache operator|. name|camel operator|. name|component operator|. name|extension operator|. name|verifier operator|. name|OptionsGroup import|; end_import begin_import import|import name|org operator|. name|apache operator|. name|camel operator|. name|component operator|. name|extension operator|. name|verifier operator|. name|ResultBuilder import|; end_import begin_import import|import name|org operator|. name|apache operator|. name|camel operator|. name|component operator|. name|extension operator|. name|verifier operator|. name|ResultErrorBuilder import|; end_import begin_import import|import name|org operator|. name|apache operator|. name|camel operator|. name|component operator|. name|extension operator|. name|verifier operator|. name|ResultErrorHelper import|; end_import begin_import import|import name|org operator|. name|apache operator|. name|camel operator|. name|component operator|. name|salesforce operator|. name|api operator|. name|SalesforceException import|; end_import begin_import import|import name|org operator|. name|apache operator|. name|camel operator|. name|component operator|. name|salesforce operator|. name|api operator|. name|dto operator|. name|RestError import|; end_import begin_class DECL|class|SalesforceComponentVerifierExtension specifier|public class|class name|SalesforceComponentVerifierExtension extends|extends name|DefaultComponentVerifierExtension block|{ DECL|method|SalesforceComponentVerifierExtension () name|SalesforceComponentVerifierExtension parameter_list|() block|{ name|super argument_list|( literal|"salesforce" argument_list|) expr_stmt|; block|} comment|// ********************************* comment|// Parameters validation comment|// ********************************* annotation|@ name|Override DECL|method|verifyParameters (Map<String, Object> parameters) specifier|protected name|Result name|verifyParameters parameter_list|( name|Map argument_list|< name|String argument_list|, name|Object argument_list|> name|parameters parameter_list|) block|{ comment|// Validate mandatory component options, needed to be done here as these comment|// options are not properly marked as mandatory in the catalog. comment|// comment|// Validation rules are borrowed from SalesforceLoginConfig's validate comment|// method, which support 3 workflow: comment|// comment|// - OAuth Username/Password Flow comment|// - OAuth Refresh Token Flow: comment|// - OAuth JWT Flow comment|// name|ResultBuilder name|builder init|= name|ResultBuilder operator|. name|withStatusAndScope argument_list|( name|Result operator|. name|Status operator|. name|OK argument_list|, name|Scope operator|. name|PARAMETERS argument_list|) operator|. name|errors argument_list|( name|ResultErrorHelper operator|. name|requiresAny argument_list|( name|parameters argument_list|, name|OptionsGroup operator|. name|withName argument_list|( name|AuthenticationType operator|. name|USERNAME_PASSWORD argument_list|) operator|. name|options argument_list|( literal|"clientId" argument_list|, literal|"clientSecret" argument_list|, literal|"userName" argument_list|, literal|"password" argument_list|, literal|"!refreshToken" argument_list|, literal|"!keystore" argument_list|) argument_list|, name|OptionsGroup operator|. name|withName argument_list|( name|AuthenticationType operator|. name|REFRESH_TOKEN argument_list|) operator|. name|options argument_list|( literal|"clientId" argument_list|, literal|"clientSecret" argument_list|, literal|"refreshToken" argument_list|, literal|"!password" argument_list|, literal|"!keystore" argument_list|) argument_list|, name|OptionsGroup operator|. name|withName argument_list|( name|AuthenticationType operator|. name|JWT argument_list|) operator|. name|options argument_list|( literal|"clientId" argument_list|, literal|"userName" argument_list|, literal|"keystore" argument_list|, literal|"!password" argument_list|, literal|"!refreshToken" argument_list|) argument_list|) argument_list|) decl_stmt|; comment|// Validate using the catalog name|super operator|. name|verifyParametersAgainstCatalog argument_list|( name|builder argument_list|, name|parameters argument_list|) expr_stmt|; return|return name|builder operator|. name|build argument_list|() return|; block|} comment|// ********************************* comment|// Connectivity validation comment|// ********************************* annotation|@ name|Override DECL|method|verifyConnectivity (Map<String, Object> parameters) specifier|protected name|Result name|verifyConnectivity parameter_list|( name|Map argument_list|< name|String argument_list|, name|Object argument_list|> name|parameters parameter_list|) block|{ comment|// Default is success name|ResultBuilder name|builder init|= name|ResultBuilder operator|. name|withStatusAndScope argument_list|( name|Result operator|. name|Status operator|. name|OK argument_list|, name|Scope operator|. name|CONNECTIVITY argument_list|) decl_stmt|; try|try block|{ name|SalesforceClientTemplate operator|. name|invoke argument_list|( name|getCamelContext argument_list|() argument_list|, name|parameters argument_list|, name|client lambda|-> block|{ name|client operator|. name|getVersions argument_list|( name|Collections operator|. name|emptyMap argument_list|() argument_list|, parameter_list|( name|response parameter_list|, name|headers parameter_list|, name|exception parameter_list|) lambda|-> name|processSalesforceException argument_list|( name|builder argument_list|, name|Optional operator|. name|ofNullable argument_list|( name|exception argument_list|) argument_list|) argument_list|) expr_stmt|; return|return literal|null return|; block|} argument_list|) expr_stmt|; block|} catch|catch parameter_list|( name|NoSuchOptionException name|e parameter_list|) block|{ name|builder operator|. name|error argument_list|( name|ResultErrorBuilder operator|. name|withMissingOption argument_list|( name|e operator|. name|getOptionName argument_list|() argument_list|) operator|. name|build argument_list|() argument_list|) expr_stmt|; block|} catch|catch parameter_list|( name|Exception name|e parameter_list|) block|{ if|if condition|( name|e operator|. name|getCause argument_list|() operator|instanceof name|SalesforceException condition|) block|{ name|processSalesforceException argument_list|( name|builder argument_list|, name|Optional operator|. name|of argument_list|( operator|( name|SalesforceException operator|) name|e operator|. name|getCause argument_list|() argument_list|) argument_list|) expr_stmt|; block|} else|else block|{ name|builder operator|. name|error argument_list|( name|ResultErrorBuilder operator|. name|withException argument_list|( name|e argument_list|) operator|. name|build argument_list|() argument_list|) expr_stmt|; block|} block|} return|return name|builder operator|. name|build argument_list|() return|; block|} comment|// ********************************* comment|// Helpers comment|// ********************************* DECL|method|processSalesforceException (ResultBuilder builder, Optional<SalesforceException> exception) specifier|private specifier|static name|void name|processSalesforceException parameter_list|( name|ResultBuilder name|builder parameter_list|, name|Optional argument_list|< name|SalesforceException argument_list|> name|exception parameter_list|) block|{ name|exception operator|. name|ifPresent argument_list|( name|e lambda|-> block|{ name|builder operator|. name|error argument_list|( name|ResultErrorBuilder operator|. name|withException argument_list|( name|e argument_list|) operator|. name|detail argument_list|( name|VerificationError operator|. name|HttpAttribute operator|. name|HTTP_CODE argument_list|, name|e operator|. name|getStatusCode argument_list|() argument_list|) operator|. name|build argument_list|() argument_list|) expr_stmt|; for|for control|( name|RestError name|error range|: name|e operator|. name|getErrors argument_list|() control|) block|{ name|builder operator|. name|error argument_list|( name|ResultErrorBuilder operator|. name|withCode argument_list|( name|VerificationError operator|. name|StandardCode operator|. name|GENERIC argument_list|) operator|. name|description argument_list|( name|error operator|. name|getMessage argument_list|() argument_list|) operator|. name|parameterKeys argument_list|( name|error operator|. name|getFields argument_list|() argument_list|) operator|. name|detail argument_list|( literal|"salesforce_code" argument_list|, name|error operator|. name|getErrorCode argument_list|() argument_list|) operator|. name|build argument_list|() argument_list|) expr_stmt|; block|} block|} argument_list|) expr_stmt|; block|} block|} end_class end_unit
16.214395
810
0.793257
07fa2224e9405c1753403629233236d413349fd0
215
public class Manobrista { public void estaciona (Veiculo v){ v.vira("Direita"); v.vira("Esquerda"); v.freia(); v.para(); System.out.println(""); } }
15.357143
38
0.465116
b12149b0c81db4caeac72a607cd47154e0ee14e5
1,155
package com.fortify.cli.tools.picocli.command.entity.ScanCentralClient; import com.fortify.cli.tools.picocli.command.mixin.DownloadPathMixin; import com.fortify.cli.tools.picocli.command.mixin.InstallPathMixin; import com.fortify.cli.tools.picocli.command.mixin.PackageVersionMixin; import com.fortify.cli.tools.toolPackage.ToolPackageBase; import picocli.CommandLine.Mixin; import picocli.CommandLine.Command; @Command( name = "scanCentralClient", aliases = {"sc-client"}, description = "A client tool for interacting with ScanCentral SAST." ) public class ScanCentralClientCommands extends ToolPackageBase { @Override @Command(name = "install", description = "Install the Fortify ScanCentral SAST Client") public void Install(@Mixin InstallPathMixin opt, @Mixin PackageVersionMixin pv) { System.out.println(this.getUnderConstructionMsg()); } @Override @Command(name = "uninstall", aliases = {"remove"}, description = "Uninstall the Fortify ScanCentral SAST Client") public void Uninstall(@Mixin PackageVersionMixin pv) { System.out.println(this.getUnderConstructionMsg()); } }
39.827586
117
0.75671
4d9082c8bc7349d352d63745cb40c70bd4cd954a
370
package fm.pattern.valex; import java.util.List; public class EntityNotFoundException extends ReportableException { private static final long serialVersionUID = -7099875229824655548L; public EntityNotFoundException(List<Reportable> errors) { super(errors); } public EntityNotFoundException(Reportable error) { super(error); } }
20.555556
71
0.732432
dc9923c63c6a453fe23c48153acdd1eff95ffec2
7,286
package org.onebusaway.io.client.test; /** * Unit tests for the Regions Utilities */ import org.onebusaway.io.client.elements.ObaRegion; import org.onebusaway.io.client.mock.MockRegion; import org.onebusaway.io.client.util.LocationUtil; import org.onebusaway.io.client.util.RegionUtils; import org.onebusaway.location.Location; import java.util.ArrayList; /** * Tests to evaluate region utilities */ public class RegionUtilTest extends ObaTestCase { public static final float APPROXIMATE_DISTANCE_EQUALS_THRESHOLD = 2; // meters // Mock regions to use in tests ObaRegion mPsRegion; ObaRegion mTampaRegion; ObaRegion mAtlantaRegion; ObaRegion mNewYorkRegion; // Locations to use in tests Location mSeattleLoc; Location mTampaLoc; Location mAtlantaLoc; Location mLondonLoc; Location mOriginLoc; Location mNewYorkLoc; @Override protected void setUp() { super.setUp(); mPsRegion = MockRegion.getPugetSound(); mTampaRegion = MockRegion.getTampa(); mAtlantaRegion = MockRegion.getAtlanta(); mNewYorkRegion = MockRegion.getNewYork(); // Region locations mSeattleLoc = LocationUtil.makeLocation(47.6097, -122.3331); mTampaLoc = LocationUtil.makeLocation(27.9681, -82.4764); mAtlantaLoc = LocationUtil.makeLocation(33.7550, -84.3900); mNewYorkLoc = LocationUtil.makeLocation(40.712784, -74.005941); // Far locations mLondonLoc = LocationUtil.makeLocation(51.5072, -0.1275); mOriginLoc = LocationUtil.makeLocation(0, 0); } public void testGetDistanceAway() { float distance = RegionUtils.getDistanceAway(mPsRegion, mSeattleLoc); assertApproximateEquals(1210, distance); distance = RegionUtils.getDistanceAway(mTampaRegion, mTampaLoc); assertApproximateEquals(3160, distance); distance = RegionUtils.getDistanceAway(mAtlantaRegion, mAtlantaLoc); assertApproximateEquals(3927, distance); } public void testGetClosestRegion() { ArrayList<ObaRegion> list = new ArrayList<>(); list.add(mPsRegion); list.add(mTampaRegion); list.add(mAtlantaRegion); list.add(mNewYorkRegion); boolean useLimiter = false; boolean enforceUsableRegions = true; /** * Without distance limiter - this should always return a region, no matter how far away * it is */ // Close to region ObaRegion closestRegion = RegionUtils.getClosestRegion(list, mSeattleLoc, useLimiter, enforceUsableRegions); assertEquals(MockRegion.PUGET_SOUND_REGION_ID, closestRegion.getId()); closestRegion = RegionUtils.getClosestRegion(list, mTampaLoc, useLimiter, enforceUsableRegions); assertEquals(MockRegion.TAMPA_REGION_ID, closestRegion.getId()); closestRegion = RegionUtils.getClosestRegion(list, mAtlantaLoc, useLimiter, enforceUsableRegions); assertEquals(MockRegion.ATLANTA_REGION_ID, closestRegion.getId()); // Far from region closestRegion = RegionUtils.getClosestRegion(list, mLondonLoc, useLimiter, enforceUsableRegions); assertEquals(MockRegion.ATLANTA_REGION_ID, closestRegion.getId()); closestRegion = RegionUtils.getClosestRegion(list, mOriginLoc, useLimiter, enforceUsableRegions); assertEquals(MockRegion.TAMPA_REGION_ID, closestRegion.getId()); /** * With distance limiter - this should only return a region if its within * the RegionUtils.DISTANCE_LIMITER threshold, otherwise null should be returned */ useLimiter = true; // Close to region closestRegion = RegionUtils.getClosestRegion(list, mSeattleLoc, useLimiter, enforceUsableRegions); assertEquals(MockRegion.PUGET_SOUND_REGION_ID, closestRegion.getId()); closestRegion = RegionUtils.getClosestRegion(list, mTampaLoc, useLimiter, enforceUsableRegions); assertEquals(MockRegion.TAMPA_REGION_ID, closestRegion.getId()); closestRegion = RegionUtils.getClosestRegion(list, mAtlantaLoc, useLimiter, enforceUsableRegions); assertEquals(MockRegion.ATLANTA_REGION_ID, closestRegion.getId()); // Far from region closestRegion = RegionUtils.getClosestRegion(list, mLondonLoc, useLimiter, enforceUsableRegions); assertNull(closestRegion); closestRegion = RegionUtils.getClosestRegion(list, mOriginLoc, useLimiter, enforceUsableRegions); assertNull(closestRegion); // Enforce usable regions, which by default should not use NYC due to not supporting the OBA real-time APIs enforceUsableRegions = true; closestRegion = RegionUtils.getClosestRegion(list, mNewYorkLoc, useLimiter, enforceUsableRegions); assertNull(closestRegion); // Turn off usable regions filter, which should give us NYC enforceUsableRegions = false; closestRegion = RegionUtils.getClosestRegion(list, mNewYorkLoc, useLimiter, enforceUsableRegions); assertEquals(MockRegion.NEW_YORK_REGION_ID, closestRegion.getId()); } public void testGetRegionSpan() { double[] results = new double[4]; RegionUtils.getRegionSpan(mTampaRegion, results); assertApproximateEquals(0.542461f, (float) results[0]); assertApproximateEquals(0.576357f, (float) results[1]); assertApproximateEquals(27.9769105f, (float) results[2]); assertApproximateEquals(-82.445851f, (float) results[3]); } public void testIsLocationWithinRegion() { assertTrue(RegionUtils.isLocationWithinRegion(mSeattleLoc, mPsRegion)); assertFalse(RegionUtils.isLocationWithinRegion(mTampaLoc, mPsRegion)); assertFalse(RegionUtils.isLocationWithinRegion(mAtlantaLoc, mPsRegion)); assertTrue(RegionUtils.isLocationWithinRegion(mTampaLoc, mTampaRegion)); assertFalse(RegionUtils.isLocationWithinRegion(mSeattleLoc, mTampaRegion)); assertFalse(RegionUtils.isLocationWithinRegion(mAtlantaLoc, mTampaRegion)); assertTrue(RegionUtils.isLocationWithinRegion(mAtlantaLoc, mAtlantaRegion)); assertFalse(RegionUtils.isLocationWithinRegion(mSeattleLoc, mAtlantaRegion)); assertFalse(RegionUtils.isLocationWithinRegion(mTampaLoc, mAtlantaRegion)); } public void testIsRegionUsable() { assertTrue(RegionUtils.isRegionUsable(mPsRegion)); assertTrue(RegionUtils.isRegionUsable(mTampaRegion)); assertTrue(RegionUtils.isRegionUsable(mAtlantaRegion)); assertFalse(RegionUtils.isRegionUsable(MockRegion.getRegionWithoutObaApis())); assertFalse(RegionUtils.isRegionUsable(MockRegion.getInactiveRegion())); assertFalse(RegionUtils.isRegionUsable(MockRegion.getRegionNoObaBaseUrl())); } /** * Asserts that the expectedDistance is approximately equal to the actual distance, within * APPROXIMATE_DISTANCE_EQUALS_THRESHOLD */ private void assertApproximateEquals(float expectedDistance, float actualDistance) { assertTrue(expectedDistance - APPROXIMATE_DISTANCE_EQUALS_THRESHOLD <= actualDistance && actualDistance <= expectedDistance + APPROXIMATE_DISTANCE_EQUALS_THRESHOLD); } }
40.032967
116
0.724815
99159ee5a3b4a2c88b21641979d2093d83a51961
28,304
/* * Copyright 2006-2009, 2017, 2020 United States Government, as represented by the * Administrator of the National Aeronautics and Space Administration. * All rights reserved. * * The NASA World Wind Java (WWJ) platform is licensed 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. * * NASA World Wind Java (WWJ) also contains the following 3rd party Open Source * software: * * Jackson Parser – Licensed under Apache 2.0 * GDAL – Licensed under MIT * JOGL – Licensed under Berkeley Software Distribution (BSD) * Gluegen – Licensed under Berkeley Software Distribution (BSD) * * A complete listing of 3rd Party software notices and licenses included in * NASA World Wind Java (WWJ) can be found in the WorldWindJava-v2.2 3rd-party * notices and licenses PDF found in code directory. */ package gov.nasa.worldwind.layers; import gov.nasa.worldwind.View; import gov.nasa.worldwind.avlist.AVKey; import gov.nasa.worldwind.geom.*; import gov.nasa.worldwind.globes.Globe; import gov.nasa.worldwind.render.*; import gov.nasa.worldwind.util.Logging; import java.awt.*; import java.awt.geom.*; import java.util.ArrayList; /** * Displays the geographic Global Area Reference System (GARS) graticule. The graticule has four levels. The first level * displays lines of latitude and longitude. The second level displays 30 minute square grid cells. The third level * displays 15 minute grid cells. The fourth and final level displays 5 minute grid cells. * * This graticule is intended to be used on 2D globes because it is so dense. * * @version $Id: GARSGraticuleLayer.java 2384 2014-10-14 21:55:10Z tgaskins $ */ public class GARSGraticuleLayer extends AbstractGraticuleLayer { public static final String GRATICULE_GARS_LEVEL_0 = "Graticule.GARSLevel0"; public static final String GRATICULE_GARS_LEVEL_1 = "Graticule.GARSLevel1"; public static final String GRATICULE_GARS_LEVEL_2 = "Graticule.GARSLevel2"; public static final String GRATICULE_GARS_LEVEL_3 = "Graticule.GARSLevel3"; protected static final int MIN_CELL_SIZE_PIXELS = 40; // TODO: make settable protected GraticuleTile[][] gridTiles = new GraticuleTile[18][36]; // 10 degrees row/col protected ArrayList<Double> latitudeLabels = new ArrayList<Double>(); protected ArrayList<Double> longitudeLabels = new ArrayList<Double>(); protected String angleFormat = Angle.ANGLE_FORMAT_DMS; /** * Indicates the eye altitudes in meters below which each level should be displayed. */ protected double[] thresholds = new double[] {1200e3, 600e3, 180e3}; // 30 min, 15 min, 5 min public GARSGraticuleLayer() { initRenderingParams(); this.setPickEnabled(false); this.setName(Logging.getMessage("layers.LatLonGraticule.Name")); } /** * Get the graticule division and angular display format. Can be one of {@link gov.nasa.worldwind.geom.Angle#ANGLE_FORMAT_DD} * or {@link gov.nasa.worldwind.geom.Angle#ANGLE_FORMAT_DMS}. * * @return the graticule division and angular display format. */ public String getAngleFormat() { return this.angleFormat; } /** * Sets the graticule division and angular display format. Can be one of {@link * gov.nasa.worldwind.geom.Angle#ANGLE_FORMAT_DD}, {@link gov.nasa.worldwind.geom.Angle#ANGLE_FORMAT_DMS} of {@link * gov.nasa.worldwind.geom.Angle#ANGLE_FORMAT_DM}. * * @param format the graticule division and angular display format. * * @throws IllegalArgumentException is <code>format</code> is null. */ public void setAngleFormat(String format) { if (format == null) { String message = Logging.getMessage("nullValue.StringIsNull"); Logging.logger().severe(message); throw new IllegalArgumentException(message); } if (this.angleFormat.equals(format)) return; this.angleFormat = format; this.clearTiles(); this.lastEyePoint = null; // force graticule to update } /** * Specifies the eye altitude below which the 30 minute grid is displayed. * * @param altitude the eye altitude in meters below which the 30 minute grid is displayed. */ public void set30MinuteThreshold(double altitude) { this.thresholds[0] = altitude; } /** * Indicates the eye altitude below which the 30 minute grid is displayed. * * @return the eye altitude in meters below which the 30 minute grid is displayed. */ public double get30MinuteThreshold() { return this.thresholds[0]; } /** * Specifies the eye altitude below which the 15 minute grid is displayed. * * @param altitude the eye altitude in meters below which the 15 minute grid is displayed. */ public void set15MinuteThreshold(double altitude) { this.thresholds[1] = altitude; } /** * Indicates the eye altitude below which the 15 minute grid is displayed. * * @return the eye altitude in meters below which the 15 minute grid is displayed. */ public double get15MinuteThreshold() { return this.thresholds[1]; } /** * Specifies the eye altitude below which the 5 minute grid is displayed. * * @param altitude the eye altitude in meters below which the 5 minute grid is displayed. */ public void set5MinuteThreshold(double altitude) { this.thresholds[2] = altitude; } /** * Indicates the eye altitude below which the 5 minute grid is displayed. * * @return the eye altitude in meters below which the 5 minute grid is displayed. */ public double get5MinuteThreshold() { return this.thresholds[2]; } // --- Graticule Rendering -------------------------------------------------------------- protected void initRenderingParams() { GraticuleRenderingParams params; // Ten degrees grid params = new GraticuleRenderingParams(); params.setValue(GraticuleRenderingParams.KEY_LINE_COLOR, Color.WHITE); params.setValue(GraticuleRenderingParams.KEY_LABEL_COLOR, Color.WHITE); params.setValue(GraticuleRenderingParams.KEY_LABEL_FONT, Font.decode("Arial-Bold-16")); setRenderingParams(GRATICULE_GARS_LEVEL_0, params); // One degree params = new GraticuleRenderingParams(); params.setValue(GraticuleRenderingParams.KEY_LINE_COLOR, Color.YELLOW); params.setValue(GraticuleRenderingParams.KEY_LABEL_COLOR, Color.YELLOW); params.setValue(GraticuleRenderingParams.KEY_LABEL_FONT, Font.decode("Arial-Bold-14")); setRenderingParams(GRATICULE_GARS_LEVEL_1, params); // 1/10th degree - 1/6th (10 minutes) params = new GraticuleRenderingParams(); params.setValue(GraticuleRenderingParams.KEY_LINE_COLOR, Color.GREEN); params.setValue(GraticuleRenderingParams.KEY_LABEL_COLOR, Color.GREEN); setRenderingParams(GRATICULE_GARS_LEVEL_2, params); // 1/100th degree - 1/60th (one minutes) params = new GraticuleRenderingParams(); params.setValue(GraticuleRenderingParams.KEY_LINE_COLOR, Color.CYAN); params.setValue(GraticuleRenderingParams.KEY_LABEL_COLOR, Color.CYAN); setRenderingParams(GRATICULE_GARS_LEVEL_3, params); } protected String[] getOrderedTypes() { return new String[] { GRATICULE_GARS_LEVEL_0, GRATICULE_GARS_LEVEL_1, GRATICULE_GARS_LEVEL_2, GRATICULE_GARS_LEVEL_3, }; } protected String getTypeFor(double resolution) { if (resolution >= 10) return GRATICULE_GARS_LEVEL_0; else if (resolution >= 0.5) return GRATICULE_GARS_LEVEL_1; else if (resolution >= .25) return GRATICULE_GARS_LEVEL_2; else if (resolution >= 5.0 / 60.0) return GRATICULE_GARS_LEVEL_3; return null; } protected void clear(DrawContext dc) { super.clear(dc); this.latitudeLabels.clear(); this.longitudeLabels.clear(); this.applyTerrainConformance(); } private void applyTerrainConformance() { String[] graticuleType = getOrderedTypes(); for (String type : graticuleType) { getRenderingParams(type).setValue( GraticuleRenderingParams.KEY_LINE_CONFORMANCE, this.terrainConformance); } } /** * Select the visible grid elements * * @param dc the current <code>DrawContext</code>. */ protected void selectRenderables(DrawContext dc) { ArrayList<GraticuleTile> tileList = getVisibleTiles(dc); if (tileList.size() > 0) { for (GraticuleTile gz : tileList) { // Select tile visible elements gz.selectRenderables(dc); } } } protected ArrayList<GraticuleTile> getVisibleTiles(DrawContext dc) { ArrayList<GraticuleTile> tileList = new ArrayList<GraticuleTile>(); Sector vs = dc.getVisibleSector(); if (vs != null) { Rectangle2D gridRectangle = getGridRectangleForSector(vs); if (gridRectangle != null) { for (int row = (int) gridRectangle.getY(); row <= gridRectangle.getY() + gridRectangle.getHeight(); row++) { for (int col = (int) gridRectangle.getX(); col <= gridRectangle.getX() + gridRectangle.getWidth(); col++) { if (gridTiles[row][col] == null) gridTiles[row][col] = new GraticuleTile(getGridSector(row, col), 20, 0); if (gridTiles[row][col].isInView(dc)) tileList.add(gridTiles[row][col]); else gridTiles[row][col].clearRenderables(); } } } } return tileList; } private Rectangle2D getGridRectangleForSector(Sector sector) { int x1 = getGridColumn(sector.getMinLongitude().degrees); int x2 = getGridColumn(sector.getMaxLongitude().degrees); int y1 = getGridRow(sector.getMinLatitude().degrees); int y2 = getGridRow(sector.getMaxLatitude().degrees); return new Rectangle(x1, y1, x2 - x1, y2 - y1); } private Sector getGridSector(int row, int col) { int minLat = -90 + row * 10; int maxLat = minLat + 10; int minLon = -180 + col * 10; int maxLon = minLon + 10; return Sector.fromDegrees(minLat, maxLat, minLon, maxLon); } private int getGridColumn(Double longitude) { int col = (int) Math.floor((longitude + 180) / 10d); return Math.min(col, 35); } private int getGridRow(Double latitude) { int row = (int) Math.floor((latitude + 90) / 10d); return Math.min(row, 17); } protected void clearTiles() { for (int row = 0; row < 18; row++) { for (int col = 0; col < 36; col++) { if (this.gridTiles[row][col] != null) { this.gridTiles[row][col].clearRenderables(); this.gridTiles[row][col] = null; } } } } protected String makeAngleLabel(Angle angle, double resolution) { double epsilon = .000000001; String label; if (this.getAngleFormat().equals(Angle.ANGLE_FORMAT_DMS)) { if (resolution >= 1) label = angle.toDecimalDegreesString(0); else { double[] dms = angle.toDMS(); if (dms[1] < epsilon && dms[2] < epsilon) label = String.format("%4d\u00B0", (int) dms[0]); else if (dms[2] < epsilon) label = String.format("%4d\u00B0 %2d\u2019", (int) dms[0], (int) dms[1]); else label = angle.toDMSString(); } } else if (this.getAngleFormat().equals(Angle.ANGLE_FORMAT_DM)) { if (resolution >= 1) label = angle.toDecimalDegreesString(0); else { double[] dms = angle.toDMS(); if (dms[1] < epsilon && dms[2] < epsilon) label = String.format("%4d\u00B0", (int) dms[0]); else if (dms[2] < epsilon) label = String.format("%4d\u00B0 %2d\u2019", (int) dms[0], (int) dms[1]); else label = angle.toDMString(); } } else // default to decimal degrees { if (resolution >= 1) label = angle.toDecimalDegreesString(0); else if (resolution >= .1) label = angle.toDecimalDegreesString(1); else if (resolution >= .01) label = angle.toDecimalDegreesString(2); else if (resolution >= .001) label = angle.toDecimalDegreesString(3); else label = angle.toDecimalDegreesString(4); } return label; } protected void addLevel0Label(double value, String labelType, String graticuleType, double resolution, LatLon labelOffset) { if (labelType.equals(GridElement.TYPE_LATITUDE_LABEL)) { if (!graticuleType.equals(GRATICULE_GARS_LEVEL_0) || !this.latitudeLabels.contains(value)) { this.latitudeLabels.add(value); String label = makeAngleLabel(Angle.fromDegrees(value), resolution); GeographicText text = new UserFacingText(label, Position.fromDegrees(value, labelOffset.getLongitude().degrees, 0)); text.setPriority(resolution * 1e6); this.addRenderable(text, graticuleType); } } else if (labelType.equals(GridElement.TYPE_LONGITUDE_LABEL)) { if (!graticuleType.equals(GRATICULE_GARS_LEVEL_0) || !this.longitudeLabels.contains(value)) { this.longitudeLabels.add(value); String label = makeAngleLabel(Angle.fromDegrees(value), resolution); GeographicText text = new UserFacingText(label, Position.fromDegrees(labelOffset.getLatitude().degrees, value, 0)); text.setPriority(resolution * 1e6); this.addRenderable(text, graticuleType); } } } protected static ArrayList<String> latLabels = new ArrayList<String>(360); protected static ArrayList<String> lonLabels = new ArrayList<String>(720); protected static String chars = "ABCDEFGHJKLMNPQRSTUVWXYZ"; protected static String[][] level2Labels = new String[][] {{"3", "4"}, {"1", "2"}}; static { for (int i = 1; i <= 720; i++) { lonLabels.add(String.format("%03d", i)); } for (int i = 0; i < 360; i++) { int length = chars.length(); int i1 = i / length; int i2 = i % length; latLabels.add(String.format("%c%c", chars.charAt(i1), chars.charAt(i2))); } } protected String makeLabel(Sector sector, String graticuleType) { if (graticuleType.equals(GRATICULE_GARS_LEVEL_1)) { int iLat = (int) ((90 + sector.getCentroid().getLatitude().degrees) * 60 / 30); int iLon = (int) ((180 + sector.getCentroid().getLongitude().degrees) * 60 / 30); return lonLabels.get(iLon) + latLabels.get(iLat); } else if (graticuleType.equals(GRATICULE_GARS_LEVEL_2)) { int minutesLat = (int) ((90 + sector.getMinLatitude().degrees) * 60); int j = (minutesLat % 30) / 15; int minutesLon = (int) ((180 + sector.getMinLongitude().degrees) * 60); int i = (minutesLon % 30) / 15; return level2Labels[j][i]; } else { return ""; } } // --- Graticule tile ---------------------------------------------------------------------- protected class GraticuleTile { private Sector sector; private int divisions; private int level; private ArrayList<GridElement> gridElements; private ArrayList<GraticuleTile> subTiles; public GraticuleTile(Sector sector, int divisions, int level) { this.sector = sector; this.divisions = divisions; this.level = level; } public Extent getExtent(Globe globe, double ve) { return Sector.computeBoundingCylinder(globe, ve, this.sector); } @SuppressWarnings({"RedundantIfStatement"}) public boolean isInView(DrawContext dc) { if (!dc.getView().getFrustumInModelCoordinates().intersects( this.getExtent(dc.getGlobe(), dc.getVerticalExaggeration()))) return false; if (this.level != 0) { if (dc.getView().getEyePosition().getAltitude() > thresholds[this.level - 1]) return false; } return true; } public double getSizeInPixels(DrawContext dc) { View view = dc.getView(); Vec4 centerPoint = getSurfacePoint(dc, this.sector.getCentroid().getLatitude(), this.sector.getCentroid().getLongitude()); double distance = view.getEyePoint().distanceTo3(centerPoint); double tileSizeMeter = this.sector.getDeltaLatRadians() * dc.getGlobe().getRadius(); return tileSizeMeter / view.computePixelSizeAtDistance(distance); } public void selectRenderables(DrawContext dc) { if (this.gridElements == null) this.createRenderables(); String graticuleType = getTypeFor(this.sector.getDeltaLatDegrees()); if (this.level == 0 && dc.getView().getEyePosition().getAltitude() > thresholds[0]) { LatLon labelOffset = computeLabelOffset(dc); for (GridElement ge : this.gridElements) { if (ge.isInView(dc)) { // Add level zero bounding lines and labels if (ge.type.equals(GridElement.TYPE_LINE_SOUTH) || ge.type.equals(GridElement.TYPE_LINE_NORTH) || ge.type.equals(GridElement.TYPE_LINE_WEST)) { addRenderable(ge.renderable, graticuleType); String labelType = ge.type.equals(GridElement.TYPE_LINE_SOUTH) || ge.type.equals(GridElement.TYPE_LINE_NORTH) ? GridElement.TYPE_LATITUDE_LABEL : GridElement.TYPE_LONGITUDE_LABEL; GARSGraticuleLayer.this.addLevel0Label(ge.value, labelType, graticuleType, this.sector.getDeltaLatDegrees(), labelOffset); } } } if (dc.getView().getEyePosition().getAltitude() > thresholds[0]) return; } // Select tile grid elements double eyeDistance = dc.getView().getEyePosition().getAltitude(); if (this.level == 0 && eyeDistance <= thresholds[0] || this.level == 1 && eyeDistance <= thresholds[1] || this.level == 2) { double resolution = this.sector.getDeltaLatDegrees() / this.divisions; graticuleType = getTypeFor(resolution); for (GridElement ge : this.gridElements) { if (ge.isInView(dc)) { addRenderable(ge.renderable, graticuleType); } } } if (this.level == 0 && eyeDistance > thresholds[1]) return; else if (this.level == 1 && eyeDistance > thresholds[2]) return; else if (this.level == 2) return; // Select child elements if (this.subTiles == null) createSubTiles(); for (GraticuleTile gt : this.subTiles) { if (gt.isInView(dc)) { gt.selectRenderables(dc); } else gt.clearRenderables(); } } public void clearRenderables() { if (this.gridElements != null) { this.gridElements.clear(); this.gridElements = null; } if (this.subTiles != null) { for (GraticuleTile gt : this.subTiles) { gt.clearRenderables(); } this.subTiles.clear(); this.subTiles = null; } } private void createSubTiles() { this.subTiles = new ArrayList<GraticuleTile>(); Sector[] sectors = this.sector.subdivide(this.divisions); int nextLevel = this.level + 1; int subDivisions = 10; if (nextLevel == 1) subDivisions = 2; else if (nextLevel == 2) subDivisions = 3; for (Sector s : sectors) { this.subTiles.add(new GraticuleTile(s, subDivisions, nextLevel)); } } /** Create the grid elements */ private void createRenderables() { this.gridElements = new ArrayList<GridElement>(); double step = sector.getDeltaLatDegrees() / this.divisions; // Generate meridians with labels double lon = sector.getMinLongitude().degrees + (this.level == 0 ? 0 : step); while (lon < sector.getMaxLongitude().degrees - step / 2) { Angle longitude = Angle.fromDegrees(lon); // Meridian ArrayList<Position> positions = new ArrayList<Position>(2); positions.add(new Position(this.sector.getMinLatitude(), longitude, 0)); positions.add(new Position(this.sector.getMaxLatitude(), longitude, 0)); Object line = createLineRenderable(positions, AVKey.LINEAR); Sector sector = Sector.fromDegrees( this.sector.getMinLatitude().degrees, this.sector.getMaxLatitude().degrees, lon, lon); String lineType = lon == this.sector.getMinLongitude().degrees ? GridElement.TYPE_LINE_WEST : GridElement.TYPE_LINE; GridElement ge = new GridElement(sector, line, lineType); ge.value = lon; this.gridElements.add(ge); // Increase longitude lon += step; } // Generate parallels double lat = this.sector.getMinLatitude().degrees + (this.level == 0 ? 0 : step); while (lat < this.sector.getMaxLatitude().degrees - step / 2) { Angle latitude = Angle.fromDegrees(lat); ArrayList<Position> positions = new ArrayList<Position>(2); positions.add(new Position(latitude, this.sector.getMinLongitude(), 0)); positions.add(new Position(latitude, this.sector.getMaxLongitude(), 0)); Object line = createLineRenderable(positions, AVKey.LINEAR); Sector sector = Sector.fromDegrees( lat, lat, this.sector.getMinLongitude().degrees, this.sector.getMaxLongitude().degrees); String lineType = lat == this.sector.getMinLatitude().degrees ? GridElement.TYPE_LINE_SOUTH : GridElement.TYPE_LINE; GridElement ge = new GridElement(sector, line, lineType); ge.value = lat; this.gridElements.add(ge); // Increase latitude lat += step; } // Draw and label a parallel at the top of the graticule. The line is apparent only on 2D globes. if (this.sector.getMaxLatitude().equals(Angle.POS90)) { ArrayList<Position> positions = new ArrayList<Position>(2); positions.add(new Position(Angle.POS90, this.sector.getMinLongitude(), 0)); positions.add(new Position(Angle.POS90, this.sector.getMaxLongitude(), 0)); Object line = createLineRenderable(positions, AVKey.LINEAR); Sector sector = Sector.fromDegrees( 90, 90, this.sector.getMinLongitude().degrees, this.sector.getMaxLongitude().degrees); GridElement ge = new GridElement(sector, line, GridElement.TYPE_LINE_NORTH); ge.value = 90; this.gridElements.add(ge); } double resolution = this.sector.getDeltaLatDegrees() / this.divisions; if (this.level == 0) { Sector[] sectors = this.sector.subdivide(20); for (int j = 0; j < 20; j++) { for (int i = 0; i < 20; i++) { Sector sector = sectors[j * 20 + i]; String label = makeLabel(sector, GRATICULE_GARS_LEVEL_1); addLabel(label, sectors[j * 20 + i], resolution); } } } else if (this.level == 1) { String label = makeLabel(this.sector, GRATICULE_GARS_LEVEL_1); Sector[] sectors = this.sector.subdivide(); addLabel(label + "3", sectors[0], resolution); addLabel(label + "4", sectors[1], resolution); addLabel(label + "1", sectors[2], resolution); addLabel(label + "2", sectors[3], resolution); } else if (this.level == 2) { String label = makeLabel(this.sector, GRATICULE_GARS_LEVEL_1); label += makeLabel(this.sector, GRATICULE_GARS_LEVEL_2); resolution = 0.26; // make label priority a little higher than level 2's Sector[] sectors = this.sector.subdivide(3); addLabel(label + "7", sectors[0], resolution); addLabel(label + "8", sectors[1], resolution); addLabel(label + "9", sectors[2], resolution); addLabel(label + "4", sectors[3], resolution); addLabel(label + "5", sectors[4], resolution); addLabel(label + "6", sectors[5], resolution); addLabel(label + "1", sectors[6], resolution); addLabel(label + "2", sectors[7], resolution); addLabel(label + "3", sectors[8], resolution); } } protected void addLabel(String label, Sector sector, double resolution) { GeographicText text = new UserFacingText(label, new Position(sector.getCentroid(), 0)); text.setPriority(resolution * 1e6); GridElement ge = new GridElement(sector, text, GridElement.TYPE_GRIDZONE_LABEL); this.gridElements.add(ge); } } }
38.613915
129
0.570591
d98bf9f5056ab9dfa7bdd01b6484b302bca2bd03
1,716
package com.diversion.element; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; /** * Content : ElementUpdater代理类, 实现Diversion指定执行 * * @author liou 2018-01-12. */ public class ElementUpdaterProxy implements ElementUpdater { private Object proxyInstance; private Method exeMed; private String tagCla; private String tagMed; private Class<?>[] medTypes; public ElementUpdaterProxy(Object proxyInstance, String tagCla, String tagMed, Class<?>... medTypes) throws NoSuchMethodException { this.tagCla = tagCla; this.tagMed = tagMed; this.medTypes = medTypes; this.proxyInstance = proxyInstance; exeMed = proxyInstance.getClass().getDeclaredMethod(tagMed, medTypes); } @Override public Object update(Element element) throws Exception { try { return exeMed.invoke(proxyInstance, element.getParams()); } catch (InvocationTargetException e) { if (e.getCause() != null) { throw (Exception) e.getCause(); } else { throw e; } } } @Override public boolean adapter(Element element) { boolean tagEquals = tagCla.equals(element.getTagCla()) && tagMed.equals(element.getTagMed()); if (tagEquals) { if (medTypes.length != element.getParams().length) { return false; } for (int i = 0; i < medTypes.length; i++) { if (medTypes[i] != element.getParams()[i].getClass()) { return false; } } return true; } return false; } }
29.084746
104
0.589161
9703d2d18b5e27ae6f40297ac2cfdb3d1dc0d136
3,798
package com.l000phone.themovietime.payticket; import android.graphics.Color; import android.os.Bundle; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentManager; import android.support.v4.app.FragmentTransaction; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.RadioButton; import android.widget.RadioGroup; import android.widget.TextView; import android.widget.Toast; import com.l000phone.themovietime.R; import com.l000phone.themovietime.utils.FragmentChangeHelper; /** * A simple {@link Fragment} subclass. */ public class PayTicketMainFragment extends Fragment { private FragmentTransaction transaction; private FragmentManager fragmentManager; public PayTicketMainFragment() { // Required empty public constructor } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // Inflate the layout for this fragment View view = inflater.inflate(R.layout.fragment_pay_ticket_main, container, false); fragmentManager = getChildFragmentManager(); transaction = fragmentManager.beginTransaction(); Bundle bundle = getArguments(); if (bundle!=null){ int index = bundle.getInt("index"); if (index == 1){ transaction.replace(R.id.payticket_firstpage_fragment_layout, new PayTicketFirstRightFragment()); transaction.commit(); } }else{ transaction.replace(R.id.payticket_firstpage_fragment_layout, new PayTicketFirstLeftFragment()); transaction.commit(); } initView(view); return view; } private void initView(View view) { final RadioGroup radioGroup = (RadioGroup) view.findViewById(R.id.payticket_title_layout); final TextView leftLine = (TextView) view.findViewById(R.id.payticket_main_btn_bottomline_left); final TextView rightLine = (TextView) view.findViewById(R.id.payticket_main_btn_bottomline_right); radioGroup.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() { @Override public void onCheckedChanged(RadioGroup group, int checkedId) { switch (checkedId){ case R.id.payticket_main_title_btnleft: leftLine.setBackgroundResource(R.color.royalblue); rightLine.setBackgroundResource(R.color.white); fragmentManager = getChildFragmentManager(); transaction = fragmentManager.beginTransaction(); transaction.replace(R.id.payticket_firstpage_fragment_layout, new PayTicketFirstLeftFragment()); FragmentChangeHelper changeHelper = new FragmentChangeHelper(); changeHelper.setFragmentTag("PayTicketFirstLeftFragment"); break; case R.id.payticket_main_title_btnright: rightLine.setBackgroundResource(R.color.royalblue); leftLine.setBackgroundResource(R.color.white); fragmentManager = getChildFragmentManager(); transaction = fragmentManager.beginTransaction(); transaction.replace(R.id.payticket_firstpage_fragment_layout, new PayTicketFirstRightFragment()); FragmentChangeHelper changeHelper1 = new FragmentChangeHelper(); changeHelper1.setFragmentTag("PayTicketFirstRightFragment"); break; } transaction.commit(); } }); } }
40.404255
121
0.655345
a04662cbb87069f131a5d10e3e3c3b87880be4e0
1,844
/* * 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. */ package org.apache.kafka.streams.kstream.internals; import org.apache.kafka.streams.kstream.ForeachAction; import org.apache.kafka.streams.processor.api.Processor; import org.apache.kafka.streams.processor.api.ProcessorSupplier; import org.apache.kafka.streams.processor.api.Record; public class KStreamPrint<K, V> implements ProcessorSupplier<K, V, Void, Void> { private final ForeachAction<K, V> action; public KStreamPrint(final ForeachAction<K, V> action) { this.action = action; } @Override public Processor<K, V, Void, Void> get() { return new KStreamPrintProcessor(); } private class KStreamPrintProcessor implements Processor<K, V, Void, Void> { @Override public void process(final Record<K, V> record) { action.apply(record.key(), record.value()); } @Override public void close() { if (action instanceof PrintForeachAction) { ((PrintForeachAction<K, V>) action).close(); } } } }
34.792453
80
0.702278
a83c739ec421b3d35af7755025ced33ce67bdf4f
1,340
package com.muratcelik.springelastic.service.implementation; import com.muratcelik.springelastic.entity.Customer; import com.muratcelik.springelastic.repository.CustomerRepository; import com.muratcelik.springelastic.service.ICustomerService; import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Service; import java.util.List; /** * @author Murat Çelik */ @Service @RequiredArgsConstructor public class CustomerService implements ICustomerService { private final CustomerRepository customerRepository; @Override public List<Customer> getAllCustomer() { return customerRepository.findAll(); } @Override public void addCustomer(Customer customer) { customerRepository.save(customer); } @Override public void deleteCustomer(Long id) { customerRepository.deleteById(id); } @Override public void updateCustomer(Customer customerDetails) { Customer customer = customerRepository.getOne(customerDetails.getId()); customer.setName(customerDetails.getName()); customer.setSurname(customerDetails.getSurname()); customer.setAge(customerDetails.getAge()); customer.setCity(customer.getCity()); customer.setOrdered(customerDetails.getOrdered()); customerRepository.save(customer); } }
29.130435
79
0.747761
e6f633be3880c6fcdd3db11f0799766a783a3bb9
1,495
/* * 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. */ package org.apache.tuweni.net.tls; import java.security.KeyStore; import javax.net.ssl.ManagerFactoryParameters; import javax.net.ssl.TrustManager; import io.netty.handler.ssl.util.SimpleTrustManagerFactory; final class SingleTrustManagerFactory extends SimpleTrustManagerFactory { private final TrustManager[] trustManagers; SingleTrustManagerFactory(TrustManager trustManager) { this.trustManagers = new TrustManager[] {trustManager}; } @Override protected void engineInit(KeyStore keyStore) {} @Override protected void engineInit(ManagerFactoryParameters managerFactoryParameters) {} @Override protected TrustManager[] engineGetTrustManagers() { return trustManagers; } }
37.375
120
0.786622
60bad822aeae56241f1449ce80bce5d64be071c6
3,664
/* * Copyright (c) CovertJaguar, 2014 http://railcraft.info * * This code is the property of CovertJaguar * and may only be used with explicit written * permission unless otherwise specified on the * license page at http://railcraft.info/wiki/info:license. */ package mods.railcraft.client.gui; import net.minecraft.client.gui.GuiButton; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.tileentity.TileEntity; import mods.railcraft.client.gui.buttons.GuiToggleButton; import mods.railcraft.common.blocks.machine.gamma.TileEnergyUnloader; import mods.railcraft.common.plugins.forge.LocalizationPlugin; import mods.railcraft.common.core.RailcraftConstants; import mods.railcraft.common.gui.containers.ContainerEnergyLoader; import mods.railcraft.common.util.misc.Game; import mods.railcraft.common.util.network.PacketDispatcher; import mods.railcraft.common.util.network.PacketGuiReturn; public class GuiUnloaderEnergy extends TileGui { private final String label; private final String button1Label = LocalizationPlugin.translate("railcraft.gui.energy.unloader.wait"); // private final String BUTTON1 = "Wait till Empty"; private TileEnergyUnloader tile; public GuiUnloaderEnergy(InventoryPlayer inv, TileEnergyUnloader tile) { super(tile, new ContainerEnergyLoader(inv, tile), RailcraftConstants.GUI_TEXTURE_FOLDER + "gui_energy_loader.png"); this.tile = tile; label = tile.getName(); } @Override public void initGui() { super.initGui(); if (tile == null) return; buttonList.clear(); int w = (width - xSize) / 2; int h = (height - ySize) / 2; buttonList.add(new GuiToggleButton(0, w + 75, h + 18, 70, button1Label, tile.waitTillEmpty())); } @Override protected void actionPerformed(GuiButton guibutton) { if (tile == null) return; if (guibutton.id == 0) { tile.setWaitTillEmpty(!tile.waitTillEmpty()); ((GuiToggleButton) guibutton).active = tile.waitTillEmpty(); } } @Override protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) { int sWidth = fontRendererObj.getStringWidth(tile.getName()); int sPos = xSize / 2 - sWidth / 2; fontRendererObj.drawString(label, sPos, 6, 0x404040); fontRendererObj.drawString(Integer.toString((int) tile.getEnergy()), 30, 55, 0x404040); String capacity = "/" + tile.getCapacity(); fontRendererObj.drawString(capacity, 28, 65, 0x404040); fontRendererObj.drawString(LocalizationPlugin.translate("railcraft.gui.ic2.energy.rate", tile.getTransferRate()), 90, 67, 0x404040); } @Override protected void drawGuiContainerBackgroundLayer(float f, int i, int j) { super.drawGuiContainerBackgroundLayer(f, i, j); int x = (width - xSize) / 2; int y = (height - ySize) / 2; if (tile.getEnergy() > 0) { int energy = tile.getEnergyBarScaled(24); drawTexturedModalRect(x + 31, y + 34, 176, 14, energy, 17); } } @Override public void onGuiClosed() { if (Game.isNotHost(tile.getWorld())) { PacketGuiReturn pkt = new PacketGuiReturn(tile); PacketDispatcher.sendToServer(pkt); } } @Override public void updateScreen() { super.updateScreen(); TileEntity t = tile.getWorld().getTileEntity(tile.getX(), tile.getY(), tile.getZ()); if (t instanceof TileEnergyUnloader) tile = (TileEnergyUnloader) t; else mc.thePlayer.closeScreen(); } }
36.277228
140
0.674127
779dd9f0528ac821b7cc9c259a390a6683184d29
868
package com.roobit.android.restclient; import java.net.HttpURLConnection; public class RestResult { int responseCode; String response; Exception exception; public RestResult() { responseCode = 0; response = ""; } public boolean isSuccess() { return responseCode < HttpURLConnection.HTTP_BAD_REQUEST && responseCode >= HttpURLConnection.HTTP_OK; } public String getResponse() { return response; } public void setResponse(String response) { this.response = response; } public void setResponseCode(int responseCode) { this.responseCode = responseCode; } public int getResponseCode() { return responseCode; } public void setException(Exception exception) { this.exception = exception; } public Exception getException() { return exception; } public boolean hasException() { return getException() != null; } }
17.714286
61
0.725806
e0447e77de03570302826d3a37009e38754ea271
2,692
package com.leisurexi.data.structures.leetcode; import lombok.extern.slf4j.Slf4j; import java.util.Arrays; /** * leetcode题号 26.删除排序数组中的重复项 * * @author: leisurexi * @date: 2020-03-15 22:18 * @since JDK 1.8 */ @Slf4j public class RemoveDuplicatesFromSortedArray { /** * 题目描述: * 给定一个排序数组,你需要在 原地 删除重复出现的元素,使得每个元素只出现一次,返回移除后数组的新长度。 * <p> * 不要使用额外的数组空间,你必须在 原地 修改输入数组 并在使用 O(1) 额外空间的条件下完成。 * <p> *   * <p> * 示例 1: * <p> * 给定数组 nums = [1,1,2], * <p> * 函数应该返回新的长度 2, 并且原数组 nums 的前两个元素被修改为 1, 2。 * <p> * 你不需要考虑数组中超出新长度后面的元素。 * 示例 2: * <p> * 给定 nums = [0,0,1,1,1,2,2,3,3,4], * <p> * 函数应该返回新的长度 5, 并且原数组 nums 的前五个元素被修改为 0, 1, 2, 3, 4。 * <p> * 你不需要考虑数组中超出新长度后面的元素。 *   * <p> * 说明: * <p> * 为什么返回数值是整数,但输出的答案是数组呢? * <p> * 请注意,输入数组是以「引用」方式传递的,这意味着在函数里修改输入数组对于调用者是可见的。 * <p> * 你可以想象内部操作如下: * <p> * // nums 是以“引用”方式传递的。也就是说,不对实参做任何拷贝 * int len = removeDuplicates(nums); * <p> * // 在函数里修改输入数组对于调用者是可见的。 * // 根据你的函数返回的长度, 它会打印出数组中该长度范围内的所有元素。 * for (int i = 0; i < len; i++) { *     print(nums[i]); * } * <p> * 来源:力扣(LeetCode) * 链接:https://leetcode-cn.com/problems/remove-duplicates-from-sorted-array * 著作权归领扣网络所有。商业转载请联系官方授权,非商业转载请注明出处。 */ public static int removeDuplicates(int[] nums) { if (nums.length < 1) { return 0; } int index = 0; int last = nums[0]; for (int i = 1; i < nums.length; i++) { int num = nums[i]; if (num > last) { nums[i] = last; nums[++index] = num; last = num; } } return index + 1; } /** * 方法:双指针法 * 算法 * 数组完成排序后,我们可以放置两个指针 ii 和 jj,其中 ii 是慢指针,而 jj 是快指针。 * 只要 nums[i] = nums[j]nums[i]=nums[j],我们就增加 jj 以跳过重复项。 * 当我们遇到 nums[j] \neq nums[i]nums[j]=nums[i] 时,跳过重复项的运行已经结束, * 因此我们必须把它(nums[j]nums[j])的值复制到 nums[i + 1]nums[i+1]。然后递增 ii, * 接着我们将再次重复相同的过程,直到 jj 到达数组的末尾为止。 */ public static int removeDuplicates_2(int[] nums) { if (nums.length < 1) { return 0; } int i = 0; for (int j = 1; j < nums.length; j++) { if (nums[i] != nums[j]) { i++; nums[i] = nums[j]; } } return i + 1; } public static void main(String[] args) { int[] nums = {1, 2}; // log.info(String.valueOf(removeDuplicates(nums))); log.info(String.valueOf(removeDuplicates_2(nums))); log.info(Arrays.toString(nums)); } }
24.252252
78
0.501486
295cd27e644989b3a4484ef817070cff8382bdda
9,340
package com.jfrog.ide.idea.ui; import com.intellij.icons.AllIcons; import com.intellij.openapi.actionSystem.ActionManager; import com.intellij.openapi.actionSystem.DefaultActionGroup; import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.project.Project; import com.intellij.ui.ScrollPaneFactory; import com.intellij.ui.components.JBLabel; import com.intellij.ui.components.JBPanel; import com.intellij.util.ui.UIUtil; import com.jfrog.ide.common.ci.BuildGeneralInfo; import com.jfrog.ide.idea.configuration.GlobalSettings; import com.jfrog.ide.idea.events.ApplicationEvents; import com.jfrog.ide.idea.events.BuildEvents; import com.jfrog.ide.idea.ui.components.LinkButton; import com.jfrog.ide.idea.ui.components.TitledPane; import com.jfrog.ide.idea.ui.menus.builds.BuildsMenu; import com.jfrog.ide.idea.ui.menus.filtermanager.CiFilterManager; import com.jfrog.ide.idea.ui.menus.filtermenu.*; import com.jfrog.ide.idea.ui.utils.ComponentUtils; import org.jetbrains.annotations.NotNull; import org.jfrog.build.api.Vcs; import org.jfrog.build.extractor.scan.DependencyTree; import org.jfrog.build.extractor.scan.Issue; import javax.swing.*; import java.awt.*; import java.text.SimpleDateFormat; import java.util.Date; import java.util.List; import java.util.Set; import static com.jfrog.ide.idea.ui.JFrogToolWindow.TITLE_FONT_SIZE; import static com.jfrog.ide.idea.ui.JFrogToolWindow.TITLE_LABEL_SIZE; import static com.jfrog.ide.idea.ui.utils.ComponentUtils.*; import static org.apache.commons.lang3.StringUtils.isAnyBlank; import static org.apache.commons.lang3.StringUtils.isBlank; /** * @author yahavi **/ public class JFrogCiToolWindow extends AbstractJFrogToolWindow { private static final SimpleDateFormat DATE_FORMAT = new SimpleDateFormat("dd MMM yyyy HH:mm:ss"); private LinkButton linkButton; private JLabel buildStarted; private JLabel buildStatus; private LinkButton seeMore; private JLabel branch; private JLabel commit; public JFrogCiToolWindow(@NotNull Project project, boolean buildsConfigured) { super(project, buildsConfigured, CiComponentsTree.getInstance(project)); } @Override String getComponentsTreeTitle() { return " Build Components (Issues #)"; } @Override IssueFilterMenu createIssueFilterMenu() { return new CiIssueFilterMenu(project); } @Override LicenseFilterMenu createLicenseFilterMenu() { return new CiLicenseFilterMenu(project); } @Override ScopeFilterMenu createScopeFilterMenu() { return new CiScopeFilterMenu(project); } @SuppressWarnings("DialogTitleCapitalization") @Override JComponent createMoreInfoView(boolean supported) { if (!GlobalSettings.getInstance().areArtifactoryCredentialsSet()) { return ComponentUtils.createNoCredentialsView(); } JLabel title = new JBLabel(" More Info"); title.setFont(title.getFont().deriveFont(TITLE_FONT_SIZE)); moreInfoPanel = new JBPanel<>(new BorderLayout()).withBackground(UIUtil.getTableBackground()); moreInfoPanel.add(supported ? createDisabledTextLabel(SELECT_COMPONENT_TEXT) : createNoBuildsView(), BorderLayout.CENTER); issuesDetailsScroll = ScrollPaneFactory.createScrollPane(moreInfoPanel, ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); return new TitledPane(JSplitPane.VERTICAL_SPLIT, TITLE_LABEL_SIZE, title, issuesDetailsScroll); } @Override public JPanel createActionToolbar() { DefaultActionGroup actionGroup = new DefaultActionGroup(ActionManager.getInstance().getAction("JFrog.RefreshBuilds")); JPanel toolbarPanel = createJFrogToolbar(actionGroup); // Add builds selector BuildsMenu buildsMenu = new BuildsMenu(project); ((CiComponentsTree) componentsTree).setBuildsMenu(buildsMenu); toolbarPanel.add(buildsMenu.getBuildButton()); // Create parent toolbar containing the builds and the component tree toolbars JPanel parentToolbarPanel = new JBPanel<>(new GridLayout(2, 0)); toolbarPanel.add(createBuildStatusPanel()); parentToolbarPanel.add(ScrollPaneFactory.createScrollPane(toolbarPanel)); parentToolbarPanel.add(createComponentsTreePanel(false)); return parentToolbarPanel; } @Override public Set<Issue> getIssuesToDisplay(List<DependencyTree> selectedNodes) { return CiFilterManager.getInstance(project).getFilteredScanIssues(selectedNodes); } @Override public void registerListeners() { super.registerListeners(); projectBusConnection.subscribe(ApplicationEvents.ON_CI_FILTER_CHANGE, () -> ApplicationManager.getApplication().invokeLater(() -> { CiComponentsTree.getInstance(project).applyFiltersForAllProjects(); updateIssuesTable(); })); projectBusConnection.subscribe(ApplicationEvents.ON_SCAN_CI_STARTED, () -> ApplicationManager.getApplication().invokeLater(this::resetViews)); projectBusConnection.subscribe(BuildEvents.ON_SELECTED_BUILD, this::setBuildDetails); projectBusConnection.subscribe(ApplicationEvents.ON_BUILDS_CONFIGURATION_CHANGE, () -> ApplicationManager.getApplication().invokeLater(this::onConfigurationChange)); } /** * Create the top panel with the build information. * * @return the build status panel */ private JPanel createBuildStatusPanel() { JPanel buildStatusPanel = new JBPanel<>(new FlowLayout(FlowLayout.LEFT, 20, 0)); buildStatus = createAndAddLabelWithTooltip("Build status", buildStatusPanel); buildStarted = createAndAddLabelWithTooltip("Build timestamp", buildStatusPanel); branch = createAndAddLabelWithTooltip("Build branch", buildStatusPanel); commit = createAndAddLabelWithTooltip("The commit message that triggered the build", buildStatusPanel); linkButton = new LinkButton("Click to view the build log"); seeMore = new LinkButton("See more in this view"); buildStatusPanel.add(linkButton); buildStatusPanel.add(seeMore); return buildStatusPanel; } /** * Set the build details in the build details toolbar * * @param buildGeneralInfo - The build general info from Artifactory */ private void setBuildDetails(BuildGeneralInfo buildGeneralInfo) { setBuildStarted(buildGeneralInfo); setBuildStatus(buildGeneralInfo); setSeeMore(buildGeneralInfo); setVcsInformation(buildGeneralInfo); setBuildLogLink(buildGeneralInfo); } private void setBuildStarted(BuildGeneralInfo buildGeneralInfo) { Date started = buildGeneralInfo != null ? buildGeneralInfo.getStarted() : null; setTextAndIcon(buildStarted, started != null ? DATE_FORMAT.format(started) : "", AllIcons.Actions.Profile); } private void setBuildStatus(BuildGeneralInfo buildGeneralInfo) { if (buildGeneralInfo == null) { setTextAndIcon(buildStatus, "", null); return; } switch (buildGeneralInfo.getStatus()) { case PASSED: setTextAndIcon(buildStatus, "Status: Success", AllIcons.RunConfigurations.TestPassed); return; case FAILED: setTextAndIcon(buildStatus, "Status: Failed", AllIcons.RunConfigurations.TestFailed); return; default: setTextAndIcon(buildStatus, "Status: Unknown", AllIcons.RunConfigurations.TestUnknown); } } private void setSeeMore(BuildGeneralInfo buildGeneralInfo) { Vcs vcs = buildGeneralInfo != null ? buildGeneralInfo.getVcs() : null; if (vcs == null || buildGeneralInfo.getStatus() == null || isAnyBlank(vcs.getBranch(), vcs.getMessage(), buildGeneralInfo.getPath())) { seeMore.init(project, "See more in this view", "https://www.jfrog.com/confluence/display/JFROG/JFrog+IntelliJ+IDEA+Plugin"); } else { seeMore.init(project, "", ""); } } private void setVcsInformation(BuildGeneralInfo buildGeneralInfo) { Vcs vcs = buildGeneralInfo != null ? buildGeneralInfo.getVcs() : null; if (vcs == null) { setTextAndIcon(branch, "", null); setTextAndIcon(commit, "", null); return; } setTextAndIcon(branch, vcs.getBranch(), AllIcons.Vcs.Branch); setTextAndIcon(commit, vcs.getMessage(), AllIcons.Vcs.CommitNode); } private void setBuildLogLink(BuildGeneralInfo buildGeneralInfo) { String link = buildGeneralInfo != null ? buildGeneralInfo.getPath() : null; linkButton.init(project, "Build Log", link); } private JLabel createAndAddLabelWithTooltip(String tooltip, JPanel buildStatusPanel) { JLabel jLabel = new JBLabel(); jLabel.setToolTipText(tooltip); buildStatusPanel.add(jLabel); return jLabel; } private void setTextAndIcon(JLabel label, String message, Icon icon) { if (isBlank(message)) { label.setText(""); label.setIcon(null); return; } label.setText(message); label.setIcon(icon); } }
41.327434
175
0.714454
9862bfcc8e8fcca73fea0ed554d26a87c26db627
10,501
package cn.wizzer.app.web.modules.controllers.platform.cms; import cn.wizzer.app.cms.modules.models.Cms_channel; import cn.wizzer.app.cms.modules.models.Cms_site; import cn.wizzer.app.cms.modules.services.CmsChannelService; import cn.wizzer.app.cms.modules.services.CmsSiteService; import cn.wizzer.app.web.commons.slog.annotation.SLog; import cn.wizzer.app.web.commons.utils.StringUtil; import cn.wizzer.framework.base.Result; import com.alibaba.dubbo.config.annotation.Reference; import org.apache.commons.lang3.StringUtils; import org.apache.shiro.authz.annotation.RequiresAuthentication; import org.apache.shiro.authz.annotation.RequiresPermissions; import org.nutz.dao.Cnd; import org.nutz.dao.Sqls; import org.nutz.ioc.loader.annotation.Inject; import org.nutz.ioc.loader.annotation.IocBean; import org.nutz.lang.Lang; import org.nutz.lang.Strings; import org.nutz.lang.Times; import org.nutz.lang.util.NutMap; import org.nutz.log.Log; import org.nutz.log.Logs; import org.nutz.mvc.annotation.At; import org.nutz.mvc.annotation.Ok; import org.nutz.mvc.annotation.Param; import javax.servlet.http.HttpServletRequest; import java.util.ArrayList; import java.util.List; /** * Created by wizzer on 2016/6/28. */ @IocBean @At("/platform/cms/channel") public class CmsChannelController { private static final Log log = Logs.get(); @Inject @Reference private CmsChannelService cmsChannelService; @Inject @Reference private CmsSiteService cmsSiteService; @At(value = {"", "/?"}) @Ok("beetl:/platform/cms/channel/index.html") @RequiresPermissions("cms.content.channel") public void index(String siteId, HttpServletRequest req) { Cms_site site = null; List<Cms_site> siteList = cmsSiteService.query(); if (Strings.isBlank(siteId) && siteList.size() > 0) { site = siteList.get(0); } if (Strings.isNotBlank(siteId)) { site = cmsSiteService.fetch(siteId); } req.setAttribute("siteList", siteList); req.setAttribute("site", site); } @At("/child/?") @Ok("json") @RequiresAuthentication public Object child(String siteId, @Param("pid") String pid, HttpServletRequest req) { List<Cms_channel> list = new ArrayList<>(); List<NutMap> treeList = new ArrayList<>(); Cnd cnd = Cnd.NEW(); if (Strings.isBlank(pid)) { cnd.and(Cnd.exps("parentId", "=", "").or("parentId", "is", null)); } else { cnd.and("parentId", "=", pid); } cnd.and("siteid", "=", siteId); cnd.asc("location").asc("path"); list = cmsChannelService.query(cnd); for (Cms_channel channel : list) { if (cmsChannelService.count(Cnd.where("parentId", "=", channel.getId())) > 0) { channel.setHasChildren(true); } NutMap map = Lang.obj2nutmap(channel); map.addv("expanded", false); map.addv("children", new ArrayList<>()); treeList.add(map); } return Result.success().addData(treeList); } @At("/tree/?") @Ok("json") @RequiresAuthentication public Object tree(String siteId, @Param("pid") String pid, HttpServletRequest req) { try { List<NutMap> treeList = new ArrayList<>(); if (Strings.isBlank(pid)) { NutMap root = NutMap.NEW().addv("value", "root").addv("label", "不选择菜单").addv("leaf",true); treeList.add(root); } Cnd cnd = Cnd.NEW(); if (Strings.isBlank(pid)) { cnd.and(Cnd.exps("parentId", "=", "").or("parentId", "is", null)); } else { cnd.and("parentId", "=", pid); } cnd.and("siteid", "=", siteId); cnd.asc("location").asc("path"); List<Cms_channel> list = cmsChannelService.query(cnd); for (Cms_channel menu : list) { NutMap map = NutMap.NEW().addv("value", menu.getId()).addv("label", menu.getName()); if (menu.isHasChildren()) { map.addv("children", new ArrayList<>()); map.addv("leaf",false); }else { map.addv("leaf",true); } treeList.add(map); } return Result.success().addData(treeList); } catch (Exception e) { return Result.error(); } } @At @Ok("json") @RequiresPermissions("cms.content.channel.add") @SLog(tag = "新建栏目", msg = "栏目名称:${args[0].name}") public Object addDo(@Param("..") Cms_channel channel, @Param(value = "parentId",df = "") String parentId, HttpServletRequest req) { try { if("root".equals(parentId)){ parentId=""; } channel.setOpBy(StringUtil.getPlatformUid()); cmsChannelService.save(channel, parentId); cmsChannelService.clearCache(); return Result.success(); } catch (Exception e) { return Result.error(); } } @At("/edit/?") @Ok("json") @RequiresPermissions("cms.content.channel") public Object edit(String id, HttpServletRequest req) { try { Cms_channel channel = cmsChannelService.fetch(id); NutMap map = Lang.obj2nutmap(channel); map.put("parentName", "无"); map.put("siteName", "无"); if (Strings.isNotBlank(channel.getParentId())) { map.put("parentName", cmsChannelService.fetch(channel.getParentId()).getName()); } if (Strings.isNotBlank(channel.getSiteid())) { map.put("siteName", cmsSiteService.fetch(channel.getSiteid()).getSite_name()); } return Result.success().addData(map); } catch (Exception e) { return Result.error(); } } @At @Ok("json") @RequiresPermissions("cms.content.channel.edit") @SLog(tag = "编辑栏目", msg = "栏目名称:${args[0].name}") public Object editDo(@Param("..") Cms_channel channel, HttpServletRequest req) { try { channel.setOpBy(StringUtil.getPlatformUid()); channel.setOpAt(Times.getTS()); cmsChannelService.updateIgnoreNull(channel); cmsChannelService.clearCache(); return Result.success(); } catch (Exception e) { return Result.error(); } } @At("/delete/?") @Ok("json") @RequiresPermissions("cms.content.channel.delete") @SLog(tag = "删除栏目", msg = "栏目名称:${args[1].getAttribute('name')}") public Object delete(String id, HttpServletRequest req) { try { Cms_channel channel = cmsChannelService.fetch(id); req.setAttribute("name", channel.getName()); cmsChannelService.deleteAndChild(channel); cmsChannelService.clearCache(); return Result.success(); } catch (Exception e) { return Result.error(); } } @At("/enable/?") @Ok("json") @RequiresPermissions("cms.content.channel.edit") @SLog(tag = "启用栏目", msg = "栏目名称:${args[1].getAttribute('name')}") public Object enable(String menuId, HttpServletRequest req) { try { req.setAttribute("name", cmsChannelService.fetch(menuId).getName()); cmsChannelService.update(org.nutz.dao.Chain.make("disabled", false), Cnd.where("id", "=", menuId)); cmsChannelService.clearCache(); return Result.success(); } catch (Exception e) { return Result.error(); } } @At("/disable/?") @Ok("json") @RequiresPermissions("cms.content.channel.edit") @SLog(tag = "禁用栏目", msg = "栏目名称:${args[1].getAttribute('name')}") public Object disable(String menuId, HttpServletRequest req) { try { req.setAttribute("name", cmsChannelService.fetch(menuId).getName()); cmsChannelService.update(org.nutz.dao.Chain.make("disabled", true), Cnd.where("id", "=", menuId)); cmsChannelService.clearCache(); return Result.success(); } catch (Exception e) { return Result.error(); } } @At("/sort/?") @Ok("json") @RequiresPermissions("cms.content.channel") public Object sort(String siteid, HttpServletRequest req) { try { List<Cms_channel> list = cmsChannelService.query(Cnd.where("siteid", "=", siteid).asc("location").asc("path")); NutMap menuMap = NutMap.NEW(); for (Cms_channel unit : list) { List<Cms_channel> list1 = menuMap.getList(unit.getParentId(), Cms_channel.class); if (list1 == null) { list1 = new ArrayList<>(); } list1.add(unit); menuMap.put(unit.getParentId(), list1); } return Result.success().addData(getTree(menuMap, "")); } catch (Exception e) { return Result.error(); } } private List<NutMap> getTree(NutMap menuMap, String pid) { List<NutMap> treeList = new ArrayList<>(); List<Cms_channel> subList = menuMap.getList(pid, Cms_channel.class); for (Cms_channel menu : subList) { NutMap map = Lang.obj2nutmap(menu); map.put("label", menu.getName()); if (menu.isHasChildren() || (menuMap.get(menu.getId()) != null)) { map.put("children", getTree(menuMap, menu.getId())); } treeList.add(map); } return treeList; } @At("/sortDo/?") @Ok("json") @RequiresPermissions("cms.content.channel.sort") public Object sortDo(String siteid, @Param("ids") String ids, HttpServletRequest req) { try { String[] menuIds = StringUtils.split(ids, ","); int i = 0; cmsChannelService.execute(Sqls.create("update cms_channel set location=0 where siteid=@siteid").setParam("siteid", siteid)); for (String s : menuIds) { if (!Strings.isBlank(s)) { cmsChannelService.update(org.nutz.dao.Chain.make("location", i), Cnd.where("id", "=", s)); i++; } } cmsChannelService.clearCache(); return Result.success(); } catch (Exception e) { return Result.error(); } } }
37.237589
136
0.576612
e39b0632e7616186f43ff0ae2341a30160e1e0d9
4,381
/* * Hibernate, Relational Persistence for Idiomatic Java * * License: GNU Lesser General Public License (LGPL), version 2.1 or later. * See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>. */ package org.hibernate.engine.spi; import java.sql.Connection; import java.util.TimeZone; import org.hibernate.ConnectionReleaseMode; import org.hibernate.FlushMode; import org.hibernate.Interceptor; import org.hibernate.Session; import org.hibernate.SessionBuilder; import org.hibernate.SessionEventListener; import org.hibernate.SharedSessionBuilder; import org.hibernate.resource.jdbc.spi.PhysicalConnectionHandlingMode; import org.hibernate.resource.jdbc.spi.StatementInspector; /** * Base class for {@link SharedSessionBuilder} implementations that wish to implement only parts of that contract * themselves while forwarding other method invocations to a delegate instance. * * @author Gunnar Morling * @author Guillaume Smet */ @SuppressWarnings("unused") public abstract class AbstractDelegatingSharedSessionBuilder<T extends SharedSessionBuilder> implements SharedSessionBuilder<T> { private final SharedSessionBuilder delegate; public AbstractDelegatingSharedSessionBuilder(SharedSessionBuilder delegate) { this.delegate = delegate; } @SuppressWarnings("unchecked") protected T getThis() { return (T) this; } public SharedSessionBuilder delegate() { return delegate; } @Override public Session openSession() { return delegate.openSession(); } @Override public T interceptor() { delegate.interceptor(); return getThis(); } @Override public T connection() { delegate.connection(); return getThis(); } @SuppressWarnings("deprecation") @Override public T connectionReleaseMode() { delegate.connectionReleaseMode(); return getThis(); } @Override public T connectionHandlingMode() { delegate.connectionHandlingMode(); return getThis(); } @Override public T autoJoinTransactions() { delegate.autoJoinTransactions(); return getThis(); } @Override public T autoClose() { delegate.autoClose(); return getThis(); } @SuppressWarnings("deprecation") @Override public T flushBeforeCompletion() { delegate.flushBeforeCompletion(); return getThis(); } @Override public T interceptor(Interceptor interceptor) { delegate.interceptor( interceptor ); return getThis(); } @Override public T noInterceptor() { delegate.noInterceptor(); return getThis(); } @Override public T statementInspector(StatementInspector statementInspector) { delegate.statementInspector( statementInspector ); return getThis(); } @Override public T connection(Connection connection) { delegate.connection( connection ); return getThis(); } @SuppressWarnings("deprecation") @Override public T connectionReleaseMode(ConnectionReleaseMode connectionReleaseMode) { delegate.connectionReleaseMode( connectionReleaseMode ); return getThis(); } @Override public T autoJoinTransactions(boolean autoJoinTransactions) { delegate.autoJoinTransactions( autoJoinTransactions ); return getThis(); } @Override public T autoClose(boolean autoClose) { delegate.autoClose( autoClose ); return getThis(); } @SuppressWarnings("deprecation") @Override public T flushBeforeCompletion(boolean flushBeforeCompletion) { delegate.flushBeforeCompletion( flushBeforeCompletion ); return getThis(); } @Override public T tenantIdentifier(String tenantIdentifier) { delegate.tenantIdentifier( tenantIdentifier ); return getThis(); } @Override public T eventListeners(SessionEventListener... listeners) { delegate.eventListeners( listeners ); return getThis(); } @Override public T clearEventListeners() { delegate.clearEventListeners(); return getThis(); } @Override public T connectionHandlingMode(PhysicalConnectionHandlingMode mode) { delegate.connectionHandlingMode( mode ); return getThis(); } @Override public T autoClear(boolean autoClear) { delegate.autoClear( autoClear ); return getThis(); } @Override public T flushMode(FlushMode flushMode) { delegate.flushMode( flushMode ); return getThis(); } @Override public T flushMode() { delegate.flushMode(); return getThis(); } @Override public T jdbcTimeZone(TimeZone timeZone) { delegate.jdbcTimeZone( timeZone ); return getThis(); } }
22.582474
129
0.760329
18500543407a949662d1b9246eb4cc1a00991b1d
282
package com.ewcms.empi.dictionary.repository; import com.ewcms.common.repository.BaseRepository; import com.ewcms.empi.dictionary.entity.CountryCode; /** *@author zhoudongchu */ public interface CountryCodeRepository extends BaseRepository<CountryCode, String> { }
23.5
85
0.776596
80532a0951aa2777e2db75658de7557b4bfbd117
1,628
package jiwoo.openstack.keystone.auth.tokens; import org.json.JSONObject; import jiwoo.openstack.rest.APIKey; import jiwoo.openstack.rest.RestResponse; abstract public class AbstractAuthTokensResponse extends RestResponse { abstract public APIKey getAPIKey(); abstract protected JSONObject passwordAuthWithUnscope(String response); abstract protected JSONObject passwordAuthWithSystemScope(String response); abstract protected JSONObject passwordAuthWithDomainIdScope(String response); abstract protected JSONObject passwordAuthWithDomainNameScope(String response); abstract protected JSONObject passwordAuthWithProjectIdScope(String response); abstract protected JSONObject passwordAuthWithProjectNameScope(String response); abstract protected JSONObject passwordAuthWithExplicitUnscope(String response); abstract protected JSONObject tokenAuthWithUnscope(String response); abstract protected JSONObject tokenAuthWithSystemScope(String response); abstract protected JSONObject tokenAuthWithDomainIdScope(String response); abstract protected JSONObject tokenAuthWithDomainNameScope(String response); abstract protected JSONObject tokenAuthWithProjectIdScope(String response); abstract protected JSONObject tokenAuthWithProjectNameScope(String response); abstract protected JSONObject tokenAuthWithExplicitUnscope(String response); abstract protected JSONObject applicationCridential(String response); abstract protected JSONObject getTokenInfo(String response); abstract protected JSONObject validateToken(String response); abstract protected JSONObject deleteToken(String response); }
33.22449
81
0.860565
d4d641acb075c669a6944e3a4f4ecd759121eb98
8,166
package org.firstinspires.ftc.teamcode; import com.qualcomm.robotcore.eventloop.opmode.Autonomous; import com.qualcomm.robotcore.hardware.DistanceSensor; import org.firstinspires.ftc.robotcore.external.navigation.DistanceUnit; import org.firstinspires.ftc.teamcode.drive.Direction; @Autonomous(name = "🔴SampleFirstFoundation") public class AutonomousRedSampleFoundationAlt extends AutoPart1 { @Override public void run() { forwardRed(); sampleStone(); firstSample(); secondSample(); foundation(); } protected void forwardRed() { driver.stopAndReset(); map.getClaw().setPosition(1); switch(pos){ case LEFT_CORNER: //prepares left arm map.getLeftAuto().setPosition(1.0); map.getLeftFinger().setPosition(0.6); driver.move(Direction.RIGHT, 0.7, 8); //closes right arm map.getRightAuto().setPosition(0.6); map.getRightFinger().setPosition(0.0); break; case MIDDLE: //prepares left arm map.getLeftAuto().setPosition(1.0); map.getLeftFinger().setPosition(0.6); //closes right arm map.getRightAuto().setPosition(0.6); map.getRightFinger().setPosition(0.0); break; case RIGHT_CORNER: //prepares right arm map.getRightAuto().setPosition(0.3); map.getRightFinger().setPosition(0.5); //closes left arm map.getLeftAuto().setPosition(0.6); map.getLeftFinger().setPosition(1.0); break; default: //prepares left arm map.getLeftAuto().setPosition(1.0); map.getLeftFinger().setPosition(0.6); //closes right arm map.getRightAuto().setPosition(0.6); map.getRightFinger().setPosition(0.0); break; } //Drives forwards a bit driver.move(Direction.BACKWARD, 0.7, 21, true); } protected void sampleStone() { //Drive up to blocks driver.moveUntil(Direction.BACKWARD, 0.3, data -> (data.getColorLeftDistance() <= 15 || data.getColorRightDistance() <= 15), true); //pick up blocks switch(pos){ case LEFT_CORNER: //uses left arm map.getLeftAuto().setPosition(1.0); map.getLeftFinger().setPosition(1.0); sleep(500); map.getLeftAuto().setPosition(0.6); break; case MIDDLE: //uses left arm map.getLeftAuto().setPosition(1.0); map.getLeftFinger().setPosition(1.0); sleep(500); map.getLeftAuto().setPosition(0.6); break; case RIGHT_CORNER: //uses right arm map.getRightAuto().setPosition(0.0); map.getRightFinger().setPosition(0.0); sleep(500); map.getRightAuto().setPosition(0.6); break; default: //uses left arm map.getLeftAuto().setPosition(1.0); map.getLeftFinger().setPosition(1.0); sleep(500); map.getLeftAuto().setPosition(0.6); break; } driver.move(Direction.FORWARD, 0.3, 8); } private void firstSample() { //move forward 5 inches and turn facing towards foundation driver.turn(0.5, 83); //drive until 120cm away from other wall //TODO: may need to adjust distance value switch(pos){ case LEFT_CORNER: driver.move(Direction.FORWARD, 0.9, 78, true); break; case MIDDLE: driver.move(Direction.FORWARD, 0.9, 70, true); break; case RIGHT_CORNER: driver.move(Direction.FORWARD, 0.9, 70, true); break; default: driver.move(Direction.FORWARD, 0.9, 70, true); break; } //face foundation driver.turn(0.5, -83); //line up with foundation driver.move(Direction.BACKWARD, 0.3, 9, true); //grab foundation and drop stone map.getLeftFinger().setPosition(0.6); map.getRightFinger().setPosition(0.5); driver.move(Direction.FORWARD, 0.3, 9, true); map.getLeftFinger().setPosition(1.0); map.getRightFinger().setPosition(0.0); } protected void secondSample() { driver.turn(0.3, -80); //TODO: change distance value so that robot is properly aligned to pick up left/middle driver.move(Direction.FORWARD, 0.9, 92, true); //Set up with correct block switch(pos){ case LEFT_CORNER: //prepares left arm map.getLeftAuto().setPosition(1.0); map.getLeftFinger().setPosition(0.6); driver.move(Direction.RIGHT, 0.7, 8); //closes right arm map.getRightAuto().setPosition(0.6); map.getRightFinger().setPosition(0.0); break; case MIDDLE: //prepares left arm map.getLeftAuto().setPosition(1.0); map.getLeftFinger().setPosition(0.6); //closes right arm map.getRightAuto().setPosition(0.6); map.getRightFinger().setPosition(0.0); break; case RIGHT_CORNER: //prepares right arm map.getRightAuto().setPosition(0.3); map.getRightFinger().setPosition(0.5); //closes left arm map.getLeftAuto().setPosition(0.6); map.getLeftFinger().setPosition(1.0); break; default: //prepares left arm map.getLeftAuto().setPosition(1.0); map.getLeftFinger().setPosition(0.6); //closes right arm map.getRightAuto().setPosition(0.6); map.getRightFinger().setPosition(0.0); break; } driver.turn(0.5, 83); //Directions are switched because robot is oriented differently on blue than on red sampleStone(); driver.turn(0.7, -76); //line up with wall driver.moveUntil(Direction.FORWARD, 0.7, data -> data.getBackDistance() <= 12, true); } protected void foundation(){ //Drives toward foundation driver.move(Direction.BACKWARD, 0.9, 100, true); //face foundation driver.turn(0.7, 75); //line up with foundation driver.move(Direction.BACKWARD, 0.3, 10, false); //grab foundation and drop stone map.getLeftFinger().setPosition(0.6); map.getRightFinger().setPosition(0.5); driver.move(Direction.RIGHT, 0.7, 4, false); map.getFoundationLeft().setPosition(1); map.getFoundationRight().setPosition(0); sleep(1000); map.getLeftFinger().setPosition(1.0); map.getRightFinger().setPosition(0.0); //push foundation into correct position driver.turn(0.7, -74); map.getFoundationLeft().setPosition(0); map.getFoundationRight().setPosition(1); driver.move(Direction.BACKWARD, 0.9, 10, true); driver.move(Direction.FORWARD, 0.9, 45, true); // // //park // driver.move(Direction.FORWARD, 0.7, 30, true); // map.getRightFinger().setPosition(0.5); // map.getRightAuto().setPosition(0); } private void correctLocation() { //driver.move(Direction.FORWARD, 0.7, RobotData.distBack - 115, true); driver.move(Direction.FORWARD, 0.7); DistanceSensor left = map.getDistanceLeft(); while (left.getDistance(DistanceUnit.CM) > 115) { } driver.stop(); } }
34.025
139
0.53784
7fbf0dcaac350338278f694d361451be849ee6d7
2,792
/* ***************************************************************************** * Name: 冀全喜 * Coursera User ID: errorfatal89@gmail.com * Last modified: October 16, 1842 **************************************************************************** */ import edu.princeton.cs.algs4.StdRandom; import edu.princeton.cs.algs4.StdStats; public class PercolationStats { private static final double CALC_CONST_FRACTION = 1.96; private final double[] threshold; private final int trials; private final double s; private double mean; private double population; // perform independent trials on an n-by-n grid public PercolationStats(int n, int trials) { validate(n, trials); this.threshold = new double[trials]; this.trials = trials; for (int i = 0; i < trials; i++) { Percolation percolation = new Percolation(n); while (!percolation.percolates()) { int row = StdRandom.uniform(n); int col = StdRandom.uniform(n); percolation.open(row + 1, col + 1); } threshold[i] = percolation.numberOfOpenSites() / ((double) (n * n)); population += threshold[i]; } mean = population / trials; double sum = 0; for (int i = 0; i < trials; i++) { sum += Math.pow((mean - threshold[i]), 2); } double sPower = sum / (trials - 1); s = Math.sqrt(sPower); } // sample mean of percolation threshold public double mean() { return StdStats.mean(new double[]{mean}); } // sample standard deviation of percolation threshold public double stddev() { return StdStats.stddev(threshold); } // low endpoint of 95% confidence interval public double confidenceLo() { return mean - (1.96 * s) / Math.sqrt(trials); } // high endpoint of 95% confidence interval public double confidenceHi() { return mean + (CALC_CONST_FRACTION * s) / Math.sqrt(trials); } private void validate(int n, int trials) { if (n <= 0 || trials <= 0) { throw new IllegalArgumentException(); } } // test client (see below) public static void main(String[] args) { if (args.length != 2) { return; } int n = Integer.parseInt(args[0]); int trials = Integer.parseInt(args[1]); PercolationStats stats = new PercolationStats(n, trials); System.out.println("mean = " + stats.mean()); System.out.println("stddev = " + stats.stddev()); System.out.println("95% confidence interval = [" + stats.confidenceLo() + ", " + stats.confidenceHi() + "]"); } }
32.465116
117
0.536175
2f6c22767f36643aa1dc35ffd474c35f2cdbe12f
2,484
package com.mercadopago.android.px.internal.features.express.slider; import androidx.annotation.NonNull; import com.mercadopago.android.px.internal.base.BasePresenter; import com.mercadopago.android.px.internal.repository.AmountConfigurationRepository; import com.mercadopago.android.px.internal.repository.PayerCostSelectionRepository; import com.mercadopago.android.px.internal.viewmodel.drawables.DrawableFragmentItem; import com.mercadopago.android.px.model.AmountConfiguration; import org.jetbrains.annotations.Nullable; class PaymentMethodPresenter extends BasePresenter<PaymentMethod.View> implements PaymentMethod.Action { private final PayerCostSelectionRepository payerCostSelectionRepository; private final AmountConfigurationRepository amountConfigurationRepository; private final DrawableFragmentItem item; /* default */ PaymentMethodPresenter(@NonNull final PayerCostSelectionRepository payerCostSelectionRepository, @NonNull final AmountConfigurationRepository amountConfigurationRepository, @NonNull final DrawableFragmentItem item) { this.payerCostSelectionRepository = payerCostSelectionRepository; this.amountConfigurationRepository = amountConfigurationRepository; this.item = item; } @Nullable private String getHighlightText() { final int payerCostIndex = payerCostSelectionRepository.get(item.getId()); final AmountConfiguration configuration = amountConfigurationRepository.getConfigurationFor(item.getId()); final int installments = configuration == null || configuration.getPayerCosts().isEmpty() ? -1 : configuration.getCurrentPayerCost(false, payerCostIndex).getInstallments(); final boolean hasReimbursement = item.getReimbursement() != null && item.getReimbursement().hasAppliedInstallment(installments); final String reimbursementMessage = hasReimbursement ? item.getReimbursement().getCard().getMessage() : null; return item.getChargeMessage() != null ? item.getChargeMessage() : reimbursementMessage; } @Override public void onFocusIn() { if (item.shouldHighlightBottomDescription()) { getView().updateHighlightText(getHighlightText()); getView().animateHighlightMessageIn(); } } @Override public void onFocusOut() { if (item.shouldHighlightBottomDescription()) { getView().animateHighlightMessageOut(); } } }
49.68
117
0.762882
f6230028b6e2c482927c628b2166d7e7102d021c
1,464
package com.microsoft.azure.documentdb.changefeedprocessor.internal; import com.microsoft.azure.documentdb.changefeedprocessor.ChangeFeedObserverContext; import com.microsoft.azure.documentdb.changefeedprocessor.IChangeFeedObserver; import java.util.concurrent.Future; public class WorkerData { private Future task; private IChangeFeedObserver observer; private ChangeFeedObserverContext context; private CancellationTokenSource cancellation; public WorkerData(Future task, IChangeFeedObserver observer, ChangeFeedObserverContext context, CancellationTokenSource cancellation) { this.task = task; this.observer = observer; this.context = context; this.cancellation = cancellation; } public Future getTask() { return task; } public void setTask(Future _task) { this.task = _task; } public IChangeFeedObserver getObserver() { return observer; } public void setObserver(IChangeFeedObserver _observer) { this.observer = _observer; } public ChangeFeedObserverContext getContext() { return context; } public void setContext(ChangeFeedObserverContext _context) { this.context = _context; } public CancellationTokenSource getCancellation() { return cancellation; } public void setCancellation(CancellationTokenSource cancellation) { this.cancellation = cancellation; } }
26.142857
137
0.721311
0a4c3e7280e2fde72b80e456162294517df6e66c
662
package leetcode; import java.util.HashSet; public class IsHappy { boolean isHappy(int num) { HashSet<Long> hs = new HashSet<>(); long product; long n = num; while (true) { product = 0; long next = n; long temp = n; while (temp != 0 || next != 0) { temp = (long) next % 10; next = (long) next / 10; product += (long) temp * temp; } boolean added = hs.add(product); if (!added) break; n = product; } if (product == 1) return true; return false; } }
21.354839
46
0.435045
5593c1dbec9bacb21aab566e4225e6b2e24d98ff
621
package io.github.ititus.si.quantity.type; import io.github.ititus.si.dimension.BaseDimension; import io.github.ititus.si.unit.BaseUnit; import io.github.ititus.si.unit.Unit; public final class ThermodynamicTemperature extends AbstractQuantityType<ThermodynamicTemperature> { public static final ThermodynamicTemperature THERMODYNAMIC_TEMPERATURE = new ThermodynamicTemperature(); public static final Unit<ThermodynamicTemperature> KELVIN = new BaseUnit<>(THERMODYNAMIC_TEMPERATURE, "K"); private ThermodynamicTemperature() { super(BaseDimension.THERMODYNAMIC_TEMPERATURE, () -> KELVIN); } }
36.529412
111
0.797101
58caf916ad97965069f86ed11b7799915a2218f6
645
/** * */ package org.jretty.util; import static org.junit.Assert.assertEquals; import java.lang.reflect.Method; import org.junit.Test; /** * * @author zollty * @since 2018年9月30日 */ public class AnnotationUtilsTest { @Order(2) private void test() { } @Test public void testFindAnnotation() { Method obj = ReflectionUtils.findMethod(AnnotationUtilsTest.class, "test"); Order ann = AnnotationUtils.findAnnotation((Method) obj, Order.class); assertEquals(2, ann.value()); ann = AnnotationUtils.findAnnotation((Method) obj, Order.class); assertEquals(2, ann.value()); } }
20.15625
83
0.657364
c9e52e04f530faa7da74d7324a83e693b6a462b6
1,291
package apoc.algo.pagerank; import org.neo4j.graphdb.RelationshipType; public interface PageRank extends PageRankAlgorithm { double ALPHA = 0.85; double ONE_MINUS_ALPHA = 1 - ALPHA; void compute( int iterations, RelationshipType... relationshipTypes ); double getResult( long node ); long numberOfNodes(); String getPropertyName(); PageRankStatistics getStatistics(); class PageRankStatistics { public long nodes, relationships, iterations, readNodeMillis, readRelationshipMillis,computeMillis,writeMillis; public boolean write; public String property; public PageRankStatistics(long nodes, long relationships, long iterations, long readNodeMillis, long readRelationshipMillis, long computeMillis, long writeMillis, boolean write, String property) { this.nodes = nodes; this.relationships = relationships; this.iterations = iterations; this.readNodeMillis = readNodeMillis; this.readRelationshipMillis = readRelationshipMillis; this.computeMillis = computeMillis; this.writeMillis = writeMillis; this.write = write; this.property = property; } public PageRankStatistics() { } } }
30.738095
204
0.684741
de4a3d5f0d444fed76d32ce87f671a8ec6083e68
2,529
package cn.droidlover.xdroidmvp.systmc.present; import com.blankj.utilcode.util.EncryptUtils; import com.blankj.utilcode.util.ToastUtils; import com.litesuits.orm.db.assit.QueryBuilder; import java.util.List; import cn.droidlover.xdroidmvp.mvp.XPresent; import cn.droidlover.xdroidmvp.net.ApiSubscriber; import cn.droidlover.xdroidmvp.net.NetError; import cn.droidlover.xdroidmvp.net.XApi; import cn.droidlover.xdroidmvp.systmc.db.OrmLiteManager; import cn.droidlover.xdroidmvp.systmc.model.UserModel; import cn.droidlover.xdroidmvp.systmc.net.Api; import cn.droidlover.xdroidmvp.systmc.ui.LoginActivity; import cn.droidlover.xdroidmvp.systmc.widget.LoadingDialog; /** * Created by ronaldo on 2017/4/21. */ public class PUser extends XPresent<LoginActivity> { /** * 在线登录 * * @param userName * @param userPwd */ public void login(final String userName, final String userPwd) { Api.getUserService().login(userName, userPwd) .compose(XApi.<UserModel>getApiTransformer()) .compose(XApi.<UserModel>getScheduler()) .compose(getV().<UserModel>bindToLifecycle()) .subscribe(new ApiSubscriber<UserModel>() { @Override protected void onFail(NetError error) { LoadingDialog.cancelDialogForLoading(); ToastUtils.showLong("登录失败"); } @Override public void onNext(UserModel userModel) { LoadingDialog.cancelDialogForLoading(); if (userModel.isSuccess()) { getV().doLogin(userModel.getData()); } else { ToastUtils.showLong(userModel.getMessage()); } } }); } /** * 离线登录 * * @param userName * @param userPwd */ public void unLineLogin(String userName, String userPwd) { List<UserModel.User> userList = OrmLiteManager.getInstance(getV()).getLiteOrm(getV()).query(new QueryBuilder<UserModel.User>(UserModel.User.class).where("login_name=? and pwd=?", userName, EncryptUtils.encryptMD5ToString(userPwd))); LoadingDialog.cancelDialogForLoading(); if (userList.isEmpty()) { ToastUtils.showLong("用户名或密码不正确"); } else { UserModel.User user = userList.get(0); getV().doLogin(user); } } }
35.125
240
0.608541
2f36c71f74e8299cc16c44e847205e977f6d60ef
2,822
package screens.pdf.tocBookmarksGalleryPdf.ios; import aquality.appium.mobile.application.AqualityServices; import aquality.appium.mobile.application.PlatformName; import aquality.appium.mobile.elements.interfaces.IButton; import aquality.appium.mobile.screens.screenfactory.ScreenType; import org.openqa.selenium.By; import screens.pdf.bookmarksPdf.BookmarksPdfScreen; import screens.pdf.galleryPdf.GalleryPdfScreen; import screens.pdf.tocBookmarksGalleryPdf.TocBookmarksGalleryPdfScreen; import screens.pdf.tocPdf.TocPdfScreen; @ScreenType(platform = PlatformName.IOS) public class IosTocBookmarksGalleryPdfScreen extends TocBookmarksGalleryPdfScreen { private final TocPdfScreen tocPdfScreen; private final GalleryPdfScreen galleryPdfScreen; private final BookmarksPdfScreen bookmarksPdfScreen; private final IButton btnResume = getElementFactory().getButton(By.xpath("//XCUIElementTypeButton[@name = \"Resume\"]"), "btnResume"); private final IButton btnBack = getElementFactory().getButton(By.xpath("//XCUIElementTypeNavigationBar/XCUIElementTypeButton[1]"), "btnBack"); private final IButton btnGallery = getElementFactory().getButton(By.xpath("//XCUIElementTypeSegmentedControl/XCUIElementTypeButton[@name = \"Grid\"]"), "btnGallery"); private final IButton btnToc = getElementFactory().getButton(By.xpath("//XCUIElementTypeSegmentedControl/XCUIElementTypeButton[@name = \"List\"]"), "btnToc"); private final IButton btnBookmarks = getElementFactory().getButton(By.xpath("//XCUIElementTypeSegmentedControl/XCUIElementTypeButton[@name = \"Bookmark N\"]"), "btnBookmarks"); public IosTocBookmarksGalleryPdfScreen() { super(By.xpath("//XCUIElementTypeButton[@name = \"Resume\"]")); tocPdfScreen = AqualityServices.getScreenFactory().getScreen(TocPdfScreen.class); galleryPdfScreen = AqualityServices.getScreenFactory().getScreen(GalleryPdfScreen.class); bookmarksPdfScreen = AqualityServices.getScreenFactory().getScreen(BookmarksPdfScreen.class); } @Override public void tapBackButton() { btnBack.click(); } @Override public void tapResumeButton() { btnResume.click(); } @Override public void tapGalleryButton() { btnGallery.click(); } @Override public void tapBookmarksButton() { btnBookmarks.click(); } @Override public TocPdfScreen getTocPdfScreen() { return tocPdfScreen; } @Override public BookmarksPdfScreen getBookmarksPdfScreen() { return bookmarksPdfScreen; } @Override public GalleryPdfScreen getGalleryPdfScreen() { return galleryPdfScreen; } @Override public void tapTocButton() { btnToc.click(); } }
36.649351
151
0.732105
92a1446b9778d80185b43adfaeaec70713e27cd7
222
package paulevs.creative; public interface CreativePlayer { public boolean isCreative(); public void setCreative(boolean creative); public boolean isFlying(); public void setFlying(boolean flying); }
18.5
44
0.734234
4e16cfc4078ec681725c078a1a910aa743178dde
21,876
package org.openxmlformats.schemas.presentationml.x2006.main.impl; import java.util.AbstractList; import java.util.ArrayList; import java.util.List; import javax.xml.namespace.QName; import org.apache.xmlbeans.SchemaType; import org.apache.xmlbeans.impl.values.XmlComplexContentImpl; import org.openxmlformats.schemas.drawingml.x2006.main.CTGroupShapeProperties; import org.openxmlformats.schemas.presentationml.x2006.main.CTConnector; import org.openxmlformats.schemas.presentationml.x2006.main.CTExtensionListModify; import org.openxmlformats.schemas.presentationml.x2006.main.CTGraphicalObjectFrame; import org.openxmlformats.schemas.presentationml.x2006.main.CTGroupShape; import org.openxmlformats.schemas.presentationml.x2006.main.CTGroupShapeNonVisual; import org.openxmlformats.schemas.presentationml.x2006.main.CTPicture; import org.openxmlformats.schemas.presentationml.x2006.main.CTShape; public class CTGroupShapeImpl extends XmlComplexContentImpl implements CTGroupShape { private static final QName NVGRPSPPR$0 = new QName("http://schemas.openxmlformats.org/presentationml/2006/main", "nvGrpSpPr"); private static final QName GRPSPPR$2 = new QName("http://schemas.openxmlformats.org/presentationml/2006/main", "grpSpPr"); private static final QName SP$4 = new QName("http://schemas.openxmlformats.org/presentationml/2006/main", "sp"); private static final QName GRPSP$6 = new QName("http://schemas.openxmlformats.org/presentationml/2006/main", "grpSp"); private static final QName GRAPHICFRAME$8 = new QName("http://schemas.openxmlformats.org/presentationml/2006/main", "graphicFrame"); private static final QName CXNSP$10 = new QName("http://schemas.openxmlformats.org/presentationml/2006/main", "cxnSp"); private static final QName PIC$12 = new QName("http://schemas.openxmlformats.org/presentationml/2006/main", "pic"); private static final QName EXTLST$14 = new QName("http://schemas.openxmlformats.org/presentationml/2006/main", "extLst"); public CTGroupShapeImpl(SchemaType var1) { super(var1); } public CTGroupShapeNonVisual getNvGrpSpPr() { synchronized(this.monitor()) { this.check_orphaned(); CTGroupShapeNonVisual var2 = null; var2 = (CTGroupShapeNonVisual)this.get_store().find_element_user(NVGRPSPPR$0, 0); return var2 == null?null:var2; } } public void setNvGrpSpPr(CTGroupShapeNonVisual var1) { synchronized(this.monitor()) { this.check_orphaned(); CTGroupShapeNonVisual var3 = null; var3 = (CTGroupShapeNonVisual)this.get_store().find_element_user(NVGRPSPPR$0, 0); if(var3 == null) { var3 = (CTGroupShapeNonVisual)this.get_store().add_element_user(NVGRPSPPR$0); } var3.set(var1); } } public CTGroupShapeNonVisual addNewNvGrpSpPr() { synchronized(this.monitor()) { this.check_orphaned(); CTGroupShapeNonVisual var2 = null; var2 = (CTGroupShapeNonVisual)this.get_store().add_element_user(NVGRPSPPR$0); return var2; } } public CTGroupShapeProperties getGrpSpPr() { synchronized(this.monitor()) { this.check_orphaned(); CTGroupShapeProperties var2 = null; var2 = (CTGroupShapeProperties)this.get_store().find_element_user(GRPSPPR$2, 0); return var2 == null?null:var2; } } public void setGrpSpPr(CTGroupShapeProperties var1) { synchronized(this.monitor()) { this.check_orphaned(); CTGroupShapeProperties var3 = null; var3 = (CTGroupShapeProperties)this.get_store().find_element_user(GRPSPPR$2, 0); if(var3 == null) { var3 = (CTGroupShapeProperties)this.get_store().add_element_user(GRPSPPR$2); } var3.set(var1); } } public CTGroupShapeProperties addNewGrpSpPr() { synchronized(this.monitor()) { this.check_orphaned(); CTGroupShapeProperties var2 = null; var2 = (CTGroupShapeProperties)this.get_store().add_element_user(GRPSPPR$2); return var2; } } public List getSpList() { synchronized(this.monitor()) { this.check_orphaned(); final class SpList extends AbstractList { public CTShape get(int var1) { return CTGroupShapeImpl.this.getSpArray(var1); } public CTShape set(int var1, CTShape var2) { CTShape var3 = CTGroupShapeImpl.this.getSpArray(var1); CTGroupShapeImpl.this.setSpArray(var1, var2); return var3; } public void add(int var1, CTShape var2) { CTGroupShapeImpl.this.insertNewSp(var1).set(var2); } public CTShape remove(int var1) { CTShape var2 = CTGroupShapeImpl.this.getSpArray(var1); CTGroupShapeImpl.this.removeSp(var1); return var2; } public int size() { return CTGroupShapeImpl.this.sizeOfSpArray(); } } return new SpList(); } } public CTShape[] getSpArray() { synchronized(this.monitor()) { this.check_orphaned(); ArrayList var2 = new ArrayList(); this.get_store().find_all_element_users(SP$4, var2); CTShape[] var3 = new CTShape[var2.size()]; var2.toArray(var3); return var3; } } public CTShape getSpArray(int var1) { synchronized(this.monitor()) { this.check_orphaned(); CTShape var3 = null; var3 = (CTShape)this.get_store().find_element_user(SP$4, var1); if(var3 == null) { throw new IndexOutOfBoundsException(); } else { return var3; } } } public int sizeOfSpArray() { synchronized(this.monitor()) { this.check_orphaned(); return this.get_store().count_elements(SP$4); } } public void setSpArray(CTShape[] var1) { synchronized(this.monitor()) { this.check_orphaned(); this.arraySetterHelper(var1, SP$4); } } public void setSpArray(int var1, CTShape var2) { synchronized(this.monitor()) { this.check_orphaned(); CTShape var4 = null; var4 = (CTShape)this.get_store().find_element_user(SP$4, var1); if(var4 == null) { throw new IndexOutOfBoundsException(); } else { var4.set(var2); } } } public CTShape insertNewSp(int var1) { synchronized(this.monitor()) { this.check_orphaned(); CTShape var3 = null; var3 = (CTShape)this.get_store().insert_element_user(SP$4, var1); return var3; } } public CTShape addNewSp() { synchronized(this.monitor()) { this.check_orphaned(); CTShape var2 = null; var2 = (CTShape)this.get_store().add_element_user(SP$4); return var2; } } public void removeSp(int var1) { synchronized(this.monitor()) { this.check_orphaned(); this.get_store().remove_element(SP$4, var1); } } public List getGrpSpList() { synchronized(this.monitor()) { this.check_orphaned(); final class GrpSpList extends AbstractList { public CTGroupShape get(int var1) { return CTGroupShapeImpl.this.getGrpSpArray(var1); } public CTGroupShape set(int var1, CTGroupShape var2) { CTGroupShape var3 = CTGroupShapeImpl.this.getGrpSpArray(var1); CTGroupShapeImpl.this.setGrpSpArray(var1, var2); return var3; } public void add(int var1, CTGroupShape var2) { CTGroupShapeImpl.this.insertNewGrpSp(var1).set(var2); } public CTGroupShape remove(int var1) { CTGroupShape var2 = CTGroupShapeImpl.this.getGrpSpArray(var1); CTGroupShapeImpl.this.removeGrpSp(var1); return var2; } public int size() { return CTGroupShapeImpl.this.sizeOfGrpSpArray(); } } return new GrpSpList(); } } public CTGroupShape[] getGrpSpArray() { synchronized(this.monitor()) { this.check_orphaned(); ArrayList var2 = new ArrayList(); this.get_store().find_all_element_users(GRPSP$6, var2); CTGroupShape[] var3 = new CTGroupShape[var2.size()]; var2.toArray(var3); return var3; } } public CTGroupShape getGrpSpArray(int var1) { synchronized(this.monitor()) { this.check_orphaned(); CTGroupShape var3 = null; var3 = (CTGroupShape)this.get_store().find_element_user(GRPSP$6, var1); if(var3 == null) { throw new IndexOutOfBoundsException(); } else { return var3; } } } public int sizeOfGrpSpArray() { synchronized(this.monitor()) { this.check_orphaned(); return this.get_store().count_elements(GRPSP$6); } } public void setGrpSpArray(CTGroupShape[] var1) { synchronized(this.monitor()) { this.check_orphaned(); this.arraySetterHelper(var1, GRPSP$6); } } public void setGrpSpArray(int var1, CTGroupShape var2) { synchronized(this.monitor()) { this.check_orphaned(); CTGroupShape var4 = null; var4 = (CTGroupShape)this.get_store().find_element_user(GRPSP$6, var1); if(var4 == null) { throw new IndexOutOfBoundsException(); } else { var4.set(var2); } } } public CTGroupShape insertNewGrpSp(int var1) { synchronized(this.monitor()) { this.check_orphaned(); CTGroupShape var3 = null; var3 = (CTGroupShape)this.get_store().insert_element_user(GRPSP$6, var1); return var3; } } public CTGroupShape addNewGrpSp() { synchronized(this.monitor()) { this.check_orphaned(); CTGroupShape var2 = null; var2 = (CTGroupShape)this.get_store().add_element_user(GRPSP$6); return var2; } } public void removeGrpSp(int var1) { synchronized(this.monitor()) { this.check_orphaned(); this.get_store().remove_element(GRPSP$6, var1); } } public List getGraphicFrameList() { synchronized(this.monitor()) { this.check_orphaned(); final class GraphicFrameList extends AbstractList { public CTGraphicalObjectFrame get(int var1) { return CTGroupShapeImpl.this.getGraphicFrameArray(var1); } public CTGraphicalObjectFrame set(int var1, CTGraphicalObjectFrame var2) { CTGraphicalObjectFrame var3 = CTGroupShapeImpl.this.getGraphicFrameArray(var1); CTGroupShapeImpl.this.setGraphicFrameArray(var1, var2); return var3; } public void add(int var1, CTGraphicalObjectFrame var2) { CTGroupShapeImpl.this.insertNewGraphicFrame(var1).set(var2); } public CTGraphicalObjectFrame remove(int var1) { CTGraphicalObjectFrame var2 = CTGroupShapeImpl.this.getGraphicFrameArray(var1); CTGroupShapeImpl.this.removeGraphicFrame(var1); return var2; } public int size() { return CTGroupShapeImpl.this.sizeOfGraphicFrameArray(); } } return new GraphicFrameList(); } } public CTGraphicalObjectFrame[] getGraphicFrameArray() { synchronized(this.monitor()) { this.check_orphaned(); ArrayList var2 = new ArrayList(); this.get_store().find_all_element_users(GRAPHICFRAME$8, var2); CTGraphicalObjectFrame[] var3 = new CTGraphicalObjectFrame[var2.size()]; var2.toArray(var3); return var3; } } public CTGraphicalObjectFrame getGraphicFrameArray(int var1) { synchronized(this.monitor()) { this.check_orphaned(); CTGraphicalObjectFrame var3 = null; var3 = (CTGraphicalObjectFrame)this.get_store().find_element_user(GRAPHICFRAME$8, var1); if(var3 == null) { throw new IndexOutOfBoundsException(); } else { return var3; } } } public int sizeOfGraphicFrameArray() { synchronized(this.monitor()) { this.check_orphaned(); return this.get_store().count_elements(GRAPHICFRAME$8); } } public void setGraphicFrameArray(CTGraphicalObjectFrame[] var1) { synchronized(this.monitor()) { this.check_orphaned(); this.arraySetterHelper(var1, GRAPHICFRAME$8); } } public void setGraphicFrameArray(int var1, CTGraphicalObjectFrame var2) { synchronized(this.monitor()) { this.check_orphaned(); CTGraphicalObjectFrame var4 = null; var4 = (CTGraphicalObjectFrame)this.get_store().find_element_user(GRAPHICFRAME$8, var1); if(var4 == null) { throw new IndexOutOfBoundsException(); } else { var4.set(var2); } } } public CTGraphicalObjectFrame insertNewGraphicFrame(int var1) { synchronized(this.monitor()) { this.check_orphaned(); CTGraphicalObjectFrame var3 = null; var3 = (CTGraphicalObjectFrame)this.get_store().insert_element_user(GRAPHICFRAME$8, var1); return var3; } } public CTGraphicalObjectFrame addNewGraphicFrame() { synchronized(this.monitor()) { this.check_orphaned(); CTGraphicalObjectFrame var2 = null; var2 = (CTGraphicalObjectFrame)this.get_store().add_element_user(GRAPHICFRAME$8); return var2; } } public void removeGraphicFrame(int var1) { synchronized(this.monitor()) { this.check_orphaned(); this.get_store().remove_element(GRAPHICFRAME$8, var1); } } public List getCxnSpList() { synchronized(this.monitor()) { this.check_orphaned(); final class CxnSpList extends AbstractList { public CTConnector get(int var1) { return CTGroupShapeImpl.this.getCxnSpArray(var1); } public CTConnector set(int var1, CTConnector var2) { CTConnector var3 = CTGroupShapeImpl.this.getCxnSpArray(var1); CTGroupShapeImpl.this.setCxnSpArray(var1, var2); return var3; } public void add(int var1, CTConnector var2) { CTGroupShapeImpl.this.insertNewCxnSp(var1).set(var2); } public CTConnector remove(int var1) { CTConnector var2 = CTGroupShapeImpl.this.getCxnSpArray(var1); CTGroupShapeImpl.this.removeCxnSp(var1); return var2; } public int size() { return CTGroupShapeImpl.this.sizeOfCxnSpArray(); } } return new CxnSpList(); } } public CTConnector[] getCxnSpArray() { synchronized(this.monitor()) { this.check_orphaned(); ArrayList var2 = new ArrayList(); this.get_store().find_all_element_users(CXNSP$10, var2); CTConnector[] var3 = new CTConnector[var2.size()]; var2.toArray(var3); return var3; } } public CTConnector getCxnSpArray(int var1) { synchronized(this.monitor()) { this.check_orphaned(); CTConnector var3 = null; var3 = (CTConnector)this.get_store().find_element_user(CXNSP$10, var1); if(var3 == null) { throw new IndexOutOfBoundsException(); } else { return var3; } } } public int sizeOfCxnSpArray() { synchronized(this.monitor()) { this.check_orphaned(); return this.get_store().count_elements(CXNSP$10); } } public void setCxnSpArray(CTConnector[] var1) { synchronized(this.monitor()) { this.check_orphaned(); this.arraySetterHelper(var1, CXNSP$10); } } public void setCxnSpArray(int var1, CTConnector var2) { synchronized(this.monitor()) { this.check_orphaned(); CTConnector var4 = null; var4 = (CTConnector)this.get_store().find_element_user(CXNSP$10, var1); if(var4 == null) { throw new IndexOutOfBoundsException(); } else { var4.set(var2); } } } public CTConnector insertNewCxnSp(int var1) { synchronized(this.monitor()) { this.check_orphaned(); CTConnector var3 = null; var3 = (CTConnector)this.get_store().insert_element_user(CXNSP$10, var1); return var3; } } public CTConnector addNewCxnSp() { synchronized(this.monitor()) { this.check_orphaned(); CTConnector var2 = null; var2 = (CTConnector)this.get_store().add_element_user(CXNSP$10); return var2; } } public void removeCxnSp(int var1) { synchronized(this.monitor()) { this.check_orphaned(); this.get_store().remove_element(CXNSP$10, var1); } } public List getPicList() { synchronized(this.monitor()) { this.check_orphaned(); final class PicList extends AbstractList { public CTPicture get(int var1) { return CTGroupShapeImpl.this.getPicArray(var1); } public CTPicture set(int var1, CTPicture var2) { CTPicture var3 = CTGroupShapeImpl.this.getPicArray(var1); CTGroupShapeImpl.this.setPicArray(var1, var2); return var3; } public void add(int var1, CTPicture var2) { CTGroupShapeImpl.this.insertNewPic(var1).set(var2); } public CTPicture remove(int var1) { CTPicture var2 = CTGroupShapeImpl.this.getPicArray(var1); CTGroupShapeImpl.this.removePic(var1); return var2; } public int size() { return CTGroupShapeImpl.this.sizeOfPicArray(); } } return new PicList(); } } public CTPicture[] getPicArray() { synchronized(this.monitor()) { this.check_orphaned(); ArrayList var2 = new ArrayList(); this.get_store().find_all_element_users(PIC$12, var2); CTPicture[] var3 = new CTPicture[var2.size()]; var2.toArray(var3); return var3; } } public CTPicture getPicArray(int var1) { synchronized(this.monitor()) { this.check_orphaned(); CTPicture var3 = null; var3 = (CTPicture)this.get_store().find_element_user(PIC$12, var1); if(var3 == null) { throw new IndexOutOfBoundsException(); } else { return var3; } } } public int sizeOfPicArray() { synchronized(this.monitor()) { this.check_orphaned(); return this.get_store().count_elements(PIC$12); } } public void setPicArray(CTPicture[] var1) { synchronized(this.monitor()) { this.check_orphaned(); this.arraySetterHelper(var1, PIC$12); } } public void setPicArray(int var1, CTPicture var2) { synchronized(this.monitor()) { this.check_orphaned(); CTPicture var4 = null; var4 = (CTPicture)this.get_store().find_element_user(PIC$12, var1); if(var4 == null) { throw new IndexOutOfBoundsException(); } else { var4.set(var2); } } } public CTPicture insertNewPic(int var1) { synchronized(this.monitor()) { this.check_orphaned(); CTPicture var3 = null; var3 = (CTPicture)this.get_store().insert_element_user(PIC$12, var1); return var3; } } public CTPicture addNewPic() { synchronized(this.monitor()) { this.check_orphaned(); CTPicture var2 = null; var2 = (CTPicture)this.get_store().add_element_user(PIC$12); return var2; } } public void removePic(int var1) { synchronized(this.monitor()) { this.check_orphaned(); this.get_store().remove_element(PIC$12, var1); } } public CTExtensionListModify getExtLst() { synchronized(this.monitor()) { this.check_orphaned(); CTExtensionListModify var2 = null; var2 = (CTExtensionListModify)this.get_store().find_element_user(EXTLST$14, 0); return var2 == null?null:var2; } } public boolean isSetExtLst() { synchronized(this.monitor()) { this.check_orphaned(); return this.get_store().count_elements(EXTLST$14) != 0; } } public void setExtLst(CTExtensionListModify var1) { synchronized(this.monitor()) { this.check_orphaned(); CTExtensionListModify var3 = null; var3 = (CTExtensionListModify)this.get_store().find_element_user(EXTLST$14, 0); if(var3 == null) { var3 = (CTExtensionListModify)this.get_store().add_element_user(EXTLST$14); } var3.set(var1); } } public CTExtensionListModify addNewExtLst() { synchronized(this.monitor()) { this.check_orphaned(); CTExtensionListModify var2 = null; var2 = (CTExtensionListModify)this.get_store().add_element_user(EXTLST$14); return var2; } } public void unsetExtLst() { synchronized(this.monitor()) { this.check_orphaned(); this.get_store().remove_element(EXTLST$14, 0); } } }
31.612717
135
0.608246
4f756a329a9c68f8f160f1b24e168e7df8689a47
3,927
package com.example.krzysiek.carmas; import android.Manifest; import android.content.Context; import android.content.pm.PackageManager; import android.location.Criteria; import android.location.Location; import android.location.LocationListener; import android.location.LocationManager; import android.os.Bundle; import android.support.v4.app.ActivityCompat; import java.util.List; public class GPSManager { private static final int gpsMinTime = 500; private static final int gpsMinDistance = 0; private static LocationManager locationManager = null; private static LocationListener locationListener = null; private static GPSCallback gpsCallback = null; Context ctx; public GPSManager(Context c) { this.ctx = c; GPSManager.locationListener = new LocationListener() { @Override public void onLocationChanged(final Location location) { if (GPSManager.gpsCallback != null) { GPSManager.gpsCallback.onGPSUpdate(location); } } @Override public void onProviderDisabled(final String provider) { } @Override public void onProviderEnabled(final String provider) { } @Override public void onStatusChanged(final String provider, final int status, final Bundle extras) { } }; } public GPSCallback getGPSCallback() { return GPSManager.gpsCallback; } public void setGPSCallback(final GPSCallback gpsCallback) { GPSManager.gpsCallback = gpsCallback; } public void startListening(final Context context) { if (GPSManager.locationManager == null) { GPSManager.locationManager = (LocationManager) context.getSystemService(Context.LOCATION_SERVICE); } final Criteria criteria = new Criteria(); criteria.setAccuracy(Criteria.ACCURACY_FINE); criteria.setSpeedRequired(true); criteria.setAltitudeRequired(false); criteria.setBearingRequired(false); criteria.setCostAllowed(true); criteria.setPowerRequirement(Criteria.POWER_LOW); final String bestProvider = GPSManager.locationManager.getBestProvider(criteria, true); if (bestProvider != null && bestProvider.length() > 0) { if (ActivityCompat.checkSelfPermission(ctx, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(ctx, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) { return; } GPSManager.locationManager.requestLocationUpdates(bestProvider, GPSManager.gpsMinTime, GPSManager.gpsMinDistance, GPSManager.locationListener); } else { final List<String> providers = GPSManager.locationManager.getProviders(true); for (final String provider : providers) { GPSManager.locationManager.requestLocationUpdates(provider, GPSManager.gpsMinTime, GPSManager.gpsMinDistance, GPSManager.locationListener); } } } public void stopListening() { try { if (GPSManager.locationManager != null && GPSManager.locationListener != null) { if (ActivityCompat.checkSelfPermission(ctx, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(ctx, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) { return; } GPSManager.locationManager.removeUpdates(GPSManager.locationListener); } GPSManager.locationManager = null; } catch (final Exception ex) { } } }
36.027523
147
0.661319
532bb590b9cf9a1dd100729e26e93dd2bf5742bc
489
package AtmApp.Service; import AtmApp.Model.Requests.UserRequest; import AtmApp.Repositories.UserRequestRepository; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.List; @Service public class UserRequestService { @Autowired UserRequestRepository userRequestRepository; public List<UserRequest> getUserRequests() { return userRequestRepository.findAll(); } }
22.227273
63
0.760736
4114d035cf8510a4d202e3fd161dfd95427e0fc2
2,426
/** * 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. */ package org.apache.tajo.jdbc; import com.google.protobuf.ByteString; import org.apache.tajo.QueryId; import org.apache.tajo.catalog.Schema; import org.apache.tajo.storage.RowStoreUtil; import org.apache.tajo.storage.Tuple; import java.io.IOException; import java.sql.SQLException; import java.util.List; import java.util.Map; import java.util.concurrent.atomic.AtomicBoolean; public class TajoMemoryResultSet extends TajoResultSetBase { private List<ByteString> serializedTuples; private AtomicBoolean closed = new AtomicBoolean(false); private RowStoreUtil.RowStoreDecoder decoder; public TajoMemoryResultSet(QueryId queryId, Schema schema, List<ByteString> serializedTuples, int maxRowNum, Map<String, String> clientSideSessionVars) { super(queryId, schema, clientSideSessionVars); this.totalRow = maxRowNum; this.serializedTuples = serializedTuples; this.decoder = RowStoreUtil.createDecoder(schema); } @Override protected void init() { cur = null; curRow = 0; } @Override public synchronized void close() throws SQLException { if (closed.getAndSet(true)) { return; } cur = null; curRow = -1; serializedTuples = null; } @Override public void beforeFirst() throws SQLException { curRow = 0; } @Override protected Tuple nextTuple() throws IOException { if (curRow < totalRow) { cur = decoder.toTuple(serializedTuples.get(curRow).toByteArray()); return cur; } else { return null; } } public boolean hasResult() { return serializedTuples.size() > 0; } }
29.585366
110
0.725062
6854672a8f522fa0e025c2ace2edfe0a33b783d2
154
package io.quarkiverse.rsocket.runtime; import reactor.core.publisher.Flux; public interface RequestStreamHandler<T> { Flux<T> handle(T payload); }
19.25
42
0.772727
3f9cdc83e025b1cdba363eb15285f48dbae7198c
1,433
/* * Copyright (c) 2016, marlonlom * * Licensed 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. */ package com.github.marlonlom.staticmaps_builder; import org.junit.Assert; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; /** * The type Static map url test. * * @author marlonlom * @version 1.0.0. */ @RunWith(JUnit4.class) public class StaticMapUrlTest { /** * Should generate static map url. */ @Test public void shouldGenerateStaticMapUrl() { float lat = (float) 4.0; float lng = (float) -74.1; int imgSize = 250; int zoom = 8; String imageUrl = StaticMapUrl.create().satellite().centered(lat, lng) .size(imgSize, imgSize).zoom(zoom) .mark(StaticMapMarker.create("0x4545AA", lat, lng).medium()) .build(); Assert.assertFalse(imageUrl.equalsIgnoreCase("")); } }
28.66
78
0.66783
6b40b559f47f604e897cb60df827e7cd2a5f09a6
4,372
/* * Copyright 2019 LINE Corporation * * LINE Corporation licenses this file to you under the Apache License, * version 2.0 (the "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at: * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * License for the specific language governing permissions and limitations * under the License. */ package com.linecorp.armeria.server; import static org.assertj.core.api.Assertions.assertThat; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.RegisterExtension; import com.linecorp.armeria.client.WebClient; import com.linecorp.armeria.common.AggregatedHttpResponse; import com.linecorp.armeria.common.HttpHeaderNames; import com.linecorp.armeria.common.HttpResponse; import com.linecorp.armeria.common.HttpStatus; import com.linecorp.armeria.testing.junit.server.ServerExtension; /** * Makes sure that {@link Server} sends a redirect response for the paths without a trailing slash, * only when there's a {@link Route} for the path with a trailing slash. */ class HttpServerAutoRedirectTest { @RegisterExtension static final ServerExtension server = new ServerExtension() { @Override protected void configure(ServerBuilder sb) throws Exception { final HttpService service = (ctx, req) -> HttpResponse.of(500); // `/a` should be redirected to `/a/`. sb.service("/a/", service); // `/b` should be redirected to `/b/`. sb.service("prefix:/b/", service); // `/c/1` should be redirected to `/c/1/`. sb.service("/c/{value}/", service); // `/d` should NOT be redirected because `/d` has a mapping. sb.service("/d", (ctx, req) -> HttpResponse.of(200)); sb.service("prefix:/d/", service); // `GET /e` should be redirected to `/e/`. // `DELETE /e` should NOT be redirected to `/e/`. sb.route().get("/e/").build(service); // `/f` should be redirected to `/f/`. // The decorator at `/f/` should NOT be evaluated during redirection, because the route doesn't // match yet. However, if a client sends a request to `/f/`, the decorator will be evaluated, // returning `202 Accepted`. sb.service("/f/", service); sb.routeDecorator().pathPrefix("/f/").build((delegate, ctx, req) -> HttpResponse.of(202)); // This should never be invoked in this test. sb.serviceUnder("/", service); } }; @Test void redirection() { final WebClient client = WebClient.of(server.httpUri("/")); AggregatedHttpResponse res; res = client.get("/a").aggregate().join(); assertThat(res.status()).isSameAs(HttpStatus.TEMPORARY_REDIRECT); assertThat(res.headers().get(HttpHeaderNames.LOCATION)).isEqualTo("/a/"); res = client.get("/b").aggregate().join(); assertThat(res.status()).isSameAs(HttpStatus.TEMPORARY_REDIRECT); assertThat(res.headers().get(HttpHeaderNames.LOCATION)).isEqualTo("/b/"); res = client.get("/c/1").aggregate().join(); assertThat(res.status()).isSameAs(HttpStatus.TEMPORARY_REDIRECT); assertThat(res.headers().get(HttpHeaderNames.LOCATION)).isEqualTo("/c/1/"); res = client.get("/d").aggregate().join(); assertThat(res.status()).isSameAs(HttpStatus.OK); res = client.get("/e").aggregate().join(); assertThat(res.status()).isSameAs(HttpStatus.TEMPORARY_REDIRECT); assertThat(res.headers().get(HttpHeaderNames.LOCATION)).isEqualTo("/e/"); res = client.delete("/e").aggregate().join(); assertThat(res.status()).isSameAs(HttpStatus.NOT_FOUND); res = client.get("/f").aggregate().join(); assertThat(res.status()).isSameAs(HttpStatus.TEMPORARY_REDIRECT); assertThat(res.headers().get(HttpHeaderNames.LOCATION)).isEqualTo("/f/"); res = client.get("/f/").aggregate().join(); assertThat(res.status()).isSameAs(HttpStatus.ACCEPTED); } }
41.638095
107
0.651418
d03517b4b17bce91eefc14343a6a4b9e49029544
750
package org.lennan.awsta.premises; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ComponentScan; @SpringBootApplication @ComponentScan("org.lennan.awsta") public class PremisesApplication { private static Log logger = LogFactory.getLog(PremisesApplication.class); @Bean(name = "premises") Premises getPremises() { return new Premises(); } public static void main(String[] args) throws Exception { SpringApplication.run(PremisesApplication.class, args); } }
31.25
75
0.788
81241eb9bfad4eba6ef3ae013ecb94a1f836c75b
1,996
package org.omg.spec.api4kp._20200801.id; import static edu.mayo.kmdp.util.DateTimeUtil.parseDateTime; import static java.lang.Long.parseLong; import com.github.zafarkhaja.semver.Version; import edu.mayo.kmdp.comparator.Contrastor; import edu.mayo.kmdp.util.DateTimeUtil; import java.util.function.Function; public class VersionTagContrastor extends Contrastor<String> { Function<String,Long> mapper; public VersionTagContrastor() { mapper = Long::parseLong; } public VersionTagContrastor(String datePattern) { mapper = s -> DateTimeUtil.parseDateTime(s,datePattern).getTime(); } public VersionTagContrastor(Function<String,Long> mapper) { this.mapper = mapper; } @Override public boolean comparable(String v1, String v2) { if (v1 == null || v2 == null) { return false; } VersionTagType t1 = VersionIdentifier.detectVersionTag(v1); VersionTagType t2 = VersionIdentifier.detectVersionTag(v2); // lenient - always try to compare two generic types return t1 == t2 || t1 == VersionTagType.GENERIC || t2 == VersionTagType.GENERIC; } @Override public int compare(String v1, String v2) { VersionTagType t1 = VersionIdentifier.detectVersionTag(v1); VersionTagType t2 = VersionIdentifier.detectVersionTag(v2); VersionTagType tagType = (t1 == t2) ? t1 : VersionTagType.GENERIC; switch (tagType) { case SEM_VER: Version sv1 = Version.valueOf(v1); Version sv2 = Version.valueOf(v2); return sv1.compareWithBuildsTo(sv2); case TIMESTAMP: return parseDateTime(v1).compareTo(parseDateTime(v2)); case SEQUENTIAL: return (int) (parseLong(v1) - parseLong(v2)); case GENERIC: long i1 = mapper.apply(v1); long i2 = mapper.apply(v2); return (int) (i1 - i2); default: throw new UnsupportedOperationException( "Unable to compare generic version tags <" + v1 + "> vs <" + v2 + ">"); } } }
28.927536
84
0.678858
da05b21b75cddcd6b90e9379b33a3231e8a27ead
5,608
package com.example.demo.core.configurer; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.serializer.SerializerFeature; import com.alibaba.fastjson.support.config.FastJsonConfig; import com.alibaba.fastjson.support.spring.FastJsonHttpMessageConverter4; import com.example.demo.core.interceptor.Interceptor1; import com.example.demo.core.ret.RetCode; import com.example.demo.core.ret.RetResult; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.context.annotation.Configuration; import org.springframework.http.MediaType; import org.springframework.http.converter.HttpMessageConverter; import org.springframework.web.servlet.config.annotation.InterceptorRegistry; import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport; import org.springframework.web.servlet.handler.HandlerInterceptorAdapter; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.nio.charset.Charset; import java.util.ArrayList; import java.util.List; /** * @author 张瑶 * @Description: * @date 2018/4/19 10:42 */ @Configuration public class WebConfigurer extends WebMvcConfigurationSupport { private final static Logger LOGGER = LoggerFactory.getLogger(WebConfigurer.class); /** * TODO 修改为自己的需求 */ private static final String IZATION = "CHUCHEN"; @Override public void addResourceHandlers(ResourceHandlerRegistry registry) { registry.addResourceHandler("swagger-ui.html") .addResourceLocations("classpath:/META-INF/resources/"); registry.addResourceHandler("/webjars/**") .addResourceLocations("classpath:/META-INF/resources/webjars/"); registry.addResourceHandler("/favicon.ico") .addResourceLocations("classpath:/META-INF/resources/favicon.ico"); super.addResourceHandlers(registry); } /** * 修改自定义消息转换器 * * @param converters */ @Override public void configureMessageConverters(List<HttpMessageConverter<?>> converters) { FastJsonHttpMessageConverter4 converter = new FastJsonHttpMessageConverter4(); converter.setSupportedMediaTypes(getSupportedMediaTypes()); FastJsonConfig config = new FastJsonConfig(); config.setSerializerFeatures( // String null -> "" SerializerFeature.WriteNullStringAsEmpty, // Number null -> 0 SerializerFeature.WriteNullNumberAsZero, //禁止循环引用 SerializerFeature.DisableCircularReferenceDetect ); converter.setFastJsonConfig(config); converter.setDefaultCharset(Charset.forName("UTF-8")); converters.add(converter); } /** * 添加拦截器 */ @Override public void addInterceptors(InterceptorRegistry registry) { registry.addInterceptor( //注意,HandlerInterceptorAdapter 这里可以修改为自己创建的拦截器 new Interceptor1() { @Override public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { String ization = request.getHeader("ization"); if(IZATION.equals(ization)){ return true; }else{ RetResult<Object> result = new RetResult<>(); result.setCode(RetCode.UNAUTHORIZED).setMsg("签名认证失败"); responseResult(response, result); return false; } } } //这里添加的是拦截的路径 /**为全部拦截 ).addPathPatterns("/userInfo/selectAlla"); } private void responseResult(HttpServletResponse response, RetResult<Object> result) { response.setCharacterEncoding("UTF-8"); response.setHeader("Content-type", "application/json;charset=UTF-8"); response.setStatus(200); try { response.getWriter().write(JSON.toJSONString(result, SerializerFeature.WriteMapNullValue)); } catch (IOException ex) { LOGGER.error(ex.getMessage()); } } private List<MediaType> getSupportedMediaTypes() { List<MediaType> supportedMediaTypes = new ArrayList<>(); supportedMediaTypes.add(MediaType.APPLICATION_JSON); supportedMediaTypes.add(MediaType.APPLICATION_JSON_UTF8); supportedMediaTypes.add(MediaType.APPLICATION_ATOM_XML); supportedMediaTypes.add(MediaType.APPLICATION_FORM_URLENCODED); supportedMediaTypes.add(MediaType.APPLICATION_OCTET_STREAM); supportedMediaTypes.add(MediaType.APPLICATION_PDF); supportedMediaTypes.add(MediaType.APPLICATION_RSS_XML); supportedMediaTypes.add(MediaType.APPLICATION_XHTML_XML); supportedMediaTypes.add(MediaType.APPLICATION_XML); supportedMediaTypes.add(MediaType.IMAGE_GIF); supportedMediaTypes.add(MediaType.IMAGE_JPEG); supportedMediaTypes.add(MediaType.IMAGE_PNG); supportedMediaTypes.add(MediaType.TEXT_EVENT_STREAM); supportedMediaTypes.add(MediaType.TEXT_HTML); supportedMediaTypes.add(MediaType.TEXT_MARKDOWN); supportedMediaTypes.add(MediaType.TEXT_PLAIN); supportedMediaTypes.add(MediaType.TEXT_XML); return supportedMediaTypes; } }
41.540741
109
0.680278
b59efe7db8cd8cfe3fec6fe03bb3f5bf84cd86fc
550
package com.matyrobbrt.matytech.api.client.screen; import com.matyrobbrt.matytech.api.container.MachineContainer; import net.minecraft.entity.player.PlayerInventory; import net.minecraft.util.ResourceLocation; import net.minecraft.util.text.ITextComponent; public class MachineContainerScreen<C extends MachineContainer<?>> extends BaseContainerScreen<C> { public MachineContainerScreen(C pMenu, PlayerInventory pPlayerInventory, ITextComponent pTitle, ResourceLocation bgTexture) { super(pMenu, pPlayerInventory, pTitle, bgTexture); } }
32.352941
99
0.829091
4c6c6b017b9f41d7b06ed35dd89a2b2ec9ba7cbc
2,694
/* * 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. */ package org.apache.harmony.pack200; import org.objectweb.asm.ClassReader; /** * Wrapper for ClassReader that enables pack200 to obtain extra class file * information */ class Pack200ClassReader extends ClassReader { private boolean lastConstantHadWideIndex; private int lastUnsignedShort; private boolean anySyntheticAttributes; private String fileName; /** * @param b * the contents of class file in the format of bytes */ public Pack200ClassReader(byte[] b) { super(b); } @Override public int readUnsignedShort(int index) { // Doing this to check whether last load-constant instruction was ldc (18) or ldc_w (19) // TODO: Assess whether this impacts on performance int unsignedShort = super.readUnsignedShort(index); if(b[index - 1] == 19) { lastUnsignedShort = unsignedShort; } else { lastUnsignedShort = Short.MIN_VALUE; } return unsignedShort; } @Override public Object readConst(int item, char[] buf) { lastConstantHadWideIndex = item == lastUnsignedShort; return super.readConst(item, buf); } @Override public String readUTF8(int offset, char[] arg1) { if (offset == 0) { // To prevent readUnsignedShort throwing ArrayIndexOutOfBoundsException. return null; } String utf8 = super.readUTF8(offset, arg1); if(!anySyntheticAttributes && "Synthetic".equals(utf8)) { anySyntheticAttributes = true; } return utf8; } public boolean lastConstantHadWideIndex() { return lastConstantHadWideIndex; } public boolean hasSyntheticAttributes() { return anySyntheticAttributes; } public void setFileName(String name) { this.fileName = name; } public String getFileName() { return fileName; } }
30.613636
92
0.683742
90fd12536f2fdd5ad3aed39ae621605789a546a1
19,946
/* * Copyright Red Hat, Inc. and/or its affiliates * and other contributors as indicated by the @author tags and * the COPYRIGHT.txt file distributed with this work. * * Licensed 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. */ package org.teiid.query.parser; import static org.teiid.query.parser.SQLParserConstants.*; import static org.teiid.query.parser.TeiidSQLParserTokenManager.*; import java.io.Reader; import java.io.StringReader; import java.util.Collections; import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.Set; import java.util.TreeSet; import org.teiid.api.exception.query.QueryParserException; import org.teiid.language.SQLConstants; import org.teiid.metadata.DataWrapper; import org.teiid.metadata.Database; import org.teiid.metadata.Datatype; import org.teiid.metadata.MetadataException; import org.teiid.metadata.MetadataFactory; import org.teiid.metadata.Parser; import org.teiid.metadata.Server; import org.teiid.query.QueryPlugin; import org.teiid.query.metadata.CompositeMetadataStore; import org.teiid.query.metadata.DatabaseStore; import org.teiid.query.metadata.DatabaseStore.Mode; import org.teiid.query.metadata.DatabaseUtil; import org.teiid.query.metadata.TransformationMetadata; import org.teiid.query.sql.lang.CacheHint; import org.teiid.query.sql.lang.Command; import org.teiid.query.sql.lang.Criteria; import org.teiid.query.sql.symbol.Expression; /** * <p>Converts a SQL-string to an object version of a query. This * QueryParser can be reused but is NOT thread-safe as the parser uses an * input stream. Putting multiple queries into the same stream will result * in unpredictable and most likely incorrect behavior. */ public class QueryParser implements Parser { private static final class SingleSchemaDatabaseStore extends DatabaseStore { private final MetadataFactory factory; private TransformationMetadata transformationMetadata; private SingleSchemaDatabaseStore(MetadataFactory factory) { this.factory = factory; } @Override public Map<String, Datatype> getRuntimeTypes() { return factory.getDataTypes(); } @Override protected TransformationMetadata getTransformationMetadata() { return transformationMetadata; } public void setTransformationMetadata( TransformationMetadata transformationMetadata) { this.transformationMetadata = transformationMetadata; } } private static ThreadLocal<QueryParser> QUERY_PARSER = new ThreadLocal<QueryParser>() { /** * @see java.lang.ThreadLocal#initialValue() */ @Override protected QueryParser initialValue() { return new QueryParser(); } }; private static final String XQUERY_DECLARE = "declare"; //$NON-NLS-1$ private static final String XML_OPEN_BRACKET = "<"; //$NON-NLS-1$ private static final String NONE = "none"; //$NON-NLS-1$ private SQLParser parser; private TeiidSQLParserTokenManager tm; /** * Construct a QueryParser - this may be reused. */ public QueryParser() {} public static QueryParser getQueryParser() { return QUERY_PARSER.get(); } /** * Helper method to get a SQLParser instance for given sql string. */ private SQLParser getSqlParser(String sql) { return getSqlParser(new StringReader(sql)); } private SQLParser getSqlParser(Reader sql) { if(parser == null) { JavaCharStream jcs = new JavaCharStream(sql); tm = new TeiidSQLParserTokenManager(new JavaCharStream(sql)); parser = new SQLParser(tm); parser.jj_input_stream = jcs; } else { parser.ReInit(sql); tm.reinit(); } return parser; } /** * Takes a SQL string representing a Command and returns the object * representation. * @param sql SQL string * instead of string litral * @return SQL object representation * @throws QueryParserException if parsing fails * @throws IllegalArgumentException if sql is null */ public Command parseCommand(String sql) throws QueryParserException { return parseCommand(sql, new ParseInfo()); } public Command parseProcedure(String sql, boolean update) throws QueryParserException { try{ if (update) { return getSqlParser(sql).forEachRowTriggerAction(new ParseInfo()); } Command result = getSqlParser(sql).procedureBodyCommand(new ParseInfo()); result.setCacheHint(SQLParserUtil.getQueryCacheOption(sql)); return result; } catch(ParseException pe) { throw convertParserException(pe); } finally { tm.reinit(); } } /** * Takes a SQL string representing a Command and returns the object * representation. * @param sql SQL string * @param parseInfo - instructions to parse * @return SQL object representation * @throws QueryParserException if parsing fails * @throws IllegalArgumentException if sql is null */ public Command parseCommand(String sql, ParseInfo parseInfo) throws QueryParserException { if(sql == null || sql.length() == 0) { throw new QueryParserException(QueryPlugin.Event.TEIID30377, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30377)); } Command result = null; try{ result = getSqlParser(sql).command(parseInfo); result.setCacheHint(SQLParserUtil.getQueryCacheOption(sql)); } catch(ParseException pe) { if(sql.startsWith(XML_OPEN_BRACKET) || sql.startsWith(XQUERY_DECLARE)) { throw new QueryParserException(QueryPlugin.Event.TEIID30378, convertParserException(pe), QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30378, sql)); } throw convertParserException(pe); } finally { tm.reinit(); } return result; } public CacheHint parseCacheHint(String sql) { if(sql == null || sql.length() == 0) { return null; } return SQLParserUtil.getQueryCacheOption(sql); } /** * Takes a SQL string representing an SQL criteria (i.e. just the WHERE * clause) and returns the object representation. * @param sql SQL criteria (WHERE clause) string * @return Criteria SQL object representation * @throws QueryParserException if parsing fails * @throws IllegalArgumentException if sql is null */ public Criteria parseCriteria(String sql) throws QueryParserException { if(sql == null) { throw new IllegalArgumentException(QueryPlugin.Util.getString("QueryParser.nullSqlCrit")); //$NON-NLS-1$ } ParseInfo dummyInfo = new ParseInfo(); Criteria result = null; try{ result = getSqlParser(sql).criteria(dummyInfo); } catch(ParseException pe) { throw convertParserException(pe); } finally { tm.reinit(); } return result; } private QueryParserException convertParserException(ParseException pe) { if (pe.currentToken == null) { List<Token> preceeding = findPreceeding(parser.token, 1); if (!preceeding.isEmpty()) { pe.currentToken = preceeding.get(0); } else { pe.currentToken = parser.token; } } QueryParserException qpe = new QueryParserException(QueryPlugin.Util.gs(QueryPlugin.Event.TEIID31100, getMessage(pe, 10))); qpe.setParseException(pe); return qpe; } /** * The default JavaCC message is not very good. This method produces a much more readable result. * @param pe * @param maxExpansions * @return */ public String getMessage(ParseException pe, int maxExpansions) { if (pe.expectedTokenSequences == null) { if (pe.currentToken == null) { return pe.getMessage(); } StringBuilder sb = encountered(pe, pe.currentToken.next!=null?1:0); if (pe.currentToken.kind == INVALID_TOKEN) { sb.append(QueryPlugin.Util.getString("QueryParser.lexicalError", pe.currentToken.image)); //$NON-NLS-1$ } else if (pe.currentToken.next != null && pe.currentToken.next.kind == -1) { sb.append(QueryPlugin.Util.getString("QueryParser.lexicalError", pe.currentToken.next.image)); //$NON-NLS-1$ } if (pe.getMessage() != null) { sb.append(pe.getMessage()); } return sb.toString(); } Token currentToken = pe.currentToken; //if the next token is invalid, we wan to use a lexical message, not the sequences if (currentToken.next.kind == INVALID_TOKEN) { StringBuilder retval = encountered(pe, 1); retval.append(QueryPlugin.Util.getString("QueryParser.lexicalError", currentToken.next.image)); //$NON-NLS-1$ return retval.toString(); } //find the longest match chain an all possible end tokens int[][] expectedTokenSequences = pe.expectedTokenSequences; int[] ex = null; Set<Integer> last = new TreeSet<Integer>(); outer : for (int i = 0; i < expectedTokenSequences.length; i++) { if (ex == null || expectedTokenSequences[i].length > ex.length) { ex = expectedTokenSequences[i]; last.clear(); } else if (expectedTokenSequences[i].length < ex.length) { continue; } else { for (int j = 0; j < ex.length -1; j++) { if (ex[j] != expectedTokenSequences[i][j]) { continue outer; //TODO : not sure how to handle this case } } } last.add(expectedTokenSequences[i][expectedTokenSequences[i].length-1]); } if (ex == null) { return pe.getMessage(); //shouldn't happen } StringBuilder retval = encountered(pe, ex.length); //output the expected tokens condensing the id/non-reserved retval.append("Was expecting: "); //$NON-NLS-1$ boolean id = last.contains(SQLParserConstants.ID); int count = 0; for (Integer t : last) { String img = tokenImage[t]; if (id && img.startsWith("\"") //$NON-NLS-1$ && Character.isLetter(img.charAt(1)) && (!SQLConstants.isReservedWord(img.substring(1, img.length()-1)) || img.equals("\"default\""))) { //$NON-NLS-1$ continue; } if (count > 0) { retval.append(" | "); //$NON-NLS-1$ } count++; if (t == SQLParserConstants.ID) { retval.append("id"); //$NON-NLS-1$ } else { retval.append(img); } if (count == maxExpansions) { retval.append(" ..."); //$NON-NLS-1$ break; } } return retval.toString(); } private StringBuilder encountered(ParseException pe, int offset) { StringBuilder retval = new StringBuilder("Encountered \""); //$NON-NLS-1$ Token currentToken = pe.currentToken; for (int i = 1; i < offset; i++) { //TODO: for large offsets we don't have to call findPreceeding currentToken = currentToken.next; } List<Token> preceeding = findPreceeding(currentToken, 2); if (offset > 0 && !preceeding.isEmpty()) { addTokenSequence(preceeding.size() + 1, retval, null, preceeding.get(0), false); } else { addTokenSequence(1, retval, null, currentToken, offset==0); } if (currentToken.next != null && offset>0) { addTokenSequence(3, retval, currentToken, currentToken.next, true); currentToken = currentToken.next; //move to the error token } retval.append("\" at line ").append(currentToken.beginLine).append(", column ").append(currentToken.beginColumn); //$NON-NLS-1$ //$NON-NLS-2$ retval.append(".\n"); //$NON-NLS-1$ return retval; } private List<Token> findPreceeding(Token currentToken, int count) { LinkedList<Token> preceeding = new LinkedList<Token>(); Token tok = this.tm.head; boolean found = false; while (tok != null) { if (tok == currentToken) { found = true; break; } preceeding.add(tok); if (preceeding.size() > count) { preceeding.removeFirst(); } tok = tok.next; } if (!found) { preceeding.clear(); } return preceeding; } private Token addTokenSequence(int maxSize, StringBuilder retval, Token last, Token tok, boolean highlight) { for (int i = 0; i < maxSize && tok != null; i++) { if (last != null && last.endColumn + 1 != tok.beginColumn && tok.kind != SQLParserConstants.EOF) { retval.append(" "); //$NON-NLS-1$ } last = tok; if (i == 0 && highlight) { retval.append("[*]"); //$NON-NLS-1$ } if (tok.image != null && !tok.image.isEmpty()) { add_escapes(tok.image, retval); if (i == 0 && highlight) { retval.append("[*]"); //$NON-NLS-1$ } } while (tok.next == null) { if (this.parser.getNextToken() == null) { break; } } tok = tok.next; } return last; } /** * Used to convert raw characters to their escaped version * when these raw version cannot be used as part of an ASCII * string literal. Also escapes double quotes. */ protected void add_escapes(String str, StringBuilder retval) { for (int i = 0; i < str.length(); i++) { char ch = str.charAt(i); switch (ch) { case 0 : continue; case '\b': retval.append("\\b"); //$NON-NLS-1$ continue; case '\t': retval.append("\\t"); //$NON-NLS-1$ continue; case '\n': retval.append("\\n"); //$NON-NLS-1$ continue; case '\f': retval.append("\\f"); //$NON-NLS-1$ continue; case '\r': retval.append("\\r"); //$NON-NLS-1$ continue; case '\"': retval.append("\\\""); //$NON-NLS-1$ continue; case '\\': retval.append("\\\\"); //$NON-NLS-1$ continue; default: if (ch < 0x20 || ch > 0x7e) { String s = "0000" + Integer.toString(ch, 16); //$NON-NLS-1$ retval.append("\\u" + s.substring(s.length() - 4, s.length())); //$NON-NLS-1$ } else { retval.append(ch); } continue; } } } /** * Takes a SQL string representing an SQL expression * and returns the object representation. * @param sql SQL expression string * @return SQL expression object * @throws QueryParserException if parsing fails * @throws IllegalArgumentException if sql is null */ public Expression parseExpression(String sql) throws QueryParserException { if(sql == null) { throw new IllegalArgumentException(QueryPlugin.Util.getString("QueryParser.nullSqlExpr")); //$NON-NLS-1$ } ParseInfo dummyInfo = new ParseInfo(); Expression result = null; try{ result = getSqlParser(sql).expression(dummyInfo); } catch(ParseException pe) { throw convertParserException(pe); } finally { tm.reinit(); } return result; } public Expression parseSelectExpression(String sql) throws QueryParserException { if(sql == null) { throw new IllegalArgumentException(QueryPlugin.Util.getString("QueryParser.nullSqlExpr")); //$NON-NLS-1$ } ParseInfo dummyInfo = new ParseInfo(); Expression result = null; try{ result = getSqlParser(sql).selectExpression(dummyInfo); } catch(ParseException pe) { throw convertParserException(pe); } finally { tm.reinit(); } return result; } public void parseDDL(MetadataFactory factory, String ddl) { parseDDL(factory, new StringReader(ddl)); } public void parseDDL(final MetadataFactory factory, Reader ddl) { SingleSchemaDatabaseStore store = new SingleSchemaDatabaseStore(factory); store.startEditing(true); Database db = new Database(factory.getVdbName(), factory.getVdbVersion()); store.databaseCreated(db); store.databaseSwitched(factory.getVdbName(), factory.getVdbVersion()); store.dataWrapperCreated(new DataWrapper(NONE)); Server server = new Server(NONE); server.setDataWrapper(NONE); store.serverCreated(server); if (factory.getSchema().isPhysical()) { Server s = new Server(factory.getSchema().getName()); s.setDataWrapper(NONE); store.serverCreated(s); } List<String> servers = Collections.emptyList(); store.schemaCreated(factory.getSchema(), servers); //with the schema created, create the TransformationMetadata CompositeMetadataStore cms = new CompositeMetadataStore(db.getMetadataStore()); TransformationMetadata qmi = new TransformationMetadata(DatabaseUtil.convert(db), cms, null, null, null); store.setTransformationMetadata(qmi.getDesignTimeMetadata()); store.schemaSwitched(factory.getSchema().getName()); store.setMode(Mode.SCHEMA); store.setStrict(true); try { parseDDL(store, ddl); } finally { store.stopEditing(); } } public void parseDDL(DatabaseStore repository, Reader ddl) throws MetadataException { SQLParser sqlParser = getSqlParser(ddl); try { sqlParser.parseMetadata(repository); } catch (org.teiid.metadata.ParseException e) { throw e; } catch (MetadataException e) { Token t = sqlParser.token; throw new org.teiid.metadata.ParseException(QueryPlugin.Event.TEIID31259, e, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID31259, t.image, t.beginLine, t.beginColumn, e.getMessage())); } catch (ParseException e) { throw new org.teiid.metadata.ParseException(QueryPlugin.Event.TEIID30386, convertParserException(e)); } finally { tm.reinit(); } } }
36.868762
162
0.590745
e50a9b396aaff0664ad9b5412d2495c38e00584b
817,455
/* *AVISO LEGAL © Copyright *Este programa esta protegido por la ley de derechos de autor. *La reproduccion o distribucion ilicita de este programa o de cualquiera de *sus partes esta penado por la ley con severas sanciones civiles y penales, *y seran objeto de todas las sanciones legales que correspondan. *Su contenido no puede copiarse para fines comerciales o de otras, *ni puede mostrarse, incluso en una version modificada, en otros sitios Web. Solo esta permitido colocar hipervinculos al sitio web. */ package com.bydan.erp.inventario.presentation.swing.jinternalframes.report; import com.bydan.erp.seguridad.business.entity.Usuario; import com.bydan.erp.seguridad.business.entity.ResumenUsuario; import com.bydan.erp.seguridad.business.entity.Opcion; import com.bydan.erp.seguridad.business.entity.PerfilOpcion; import com.bydan.erp.seguridad.business.entity.PerfilCampo; import com.bydan.erp.seguridad.business.entity.PerfilAccion; import com.bydan.erp.seguridad.business.entity.ParametroGeneralSg; import com.bydan.erp.seguridad.business.entity.ParametroGeneralUsuario; import com.bydan.erp.seguridad.business.entity.Modulo; import com.bydan.erp.seguridad.business.entity.Accion; import com.bydan.erp.seguridad.util.SistemaParameterReturnGeneralAdditional; import com.bydan.erp.seguridad.util.SistemaParameterReturnGeneral; //import com.bydan.erp.seguridad.business.entity.PerfilAccion; import com.bydan.erp.seguridad.util.SistemaConstantesFunciones; import com.bydan.erp.seguridad.util.SistemaConstantesFuncionesAdditional; import com.bydan.erp.seguridad.business.logic.SistemaLogicAdditional; //import com.bydan.erp.inventario.util.ProcesoPreciosPorcentajeConstantesFunciones; import com.bydan.erp.inventario.util.report.ProcesoPreciosPorcentajeParameterReturnGeneral; //import com.bydan.erp.inventario.util.report.ProcesoPreciosPorcentajeParameterGeneral; //import com.bydan.erp.inventario.presentation.report.source.report.ProcesoPreciosPorcentajeBean; import com.bydan.framework.erp.business.dataaccess.ConstantesSql; import com.bydan.framework.erp.business.entity.Classe; import com.bydan.framework.erp.business.entity.DatoGeneral; import com.bydan.framework.erp.business.entity.GeneralEntityParameterGeneral; import com.bydan.framework.erp.business.entity.OrderBy; import com.bydan.framework.erp.business.entity.DatoGeneralMinimo; import com.bydan.framework.erp.business.entity.GeneralEntity; import com.bydan.framework.erp.business.entity.Mensajes; import com.bydan.framework.erp.business.entity.GeneralEntityParameterReturnGeneral; //import com.bydan.framework.erp.business.entity.MaintenanceType; import com.bydan.framework.erp.util.MaintenanceType; import com.bydan.framework.erp.util.FuncionesReporte; import com.bydan.framework.erp.business.logic.DatosCliente; import com.bydan.framework.erp.business.logic.Pagination; import com.bydan.erp.inventario.presentation.swing.jinternalframes.auxiliar.report.*; import com.bydan.framework.erp.presentation.desktop.swing.TablaGeneralTotalModel; import com.bydan.framework.erp.presentation.desktop.swing.TablaGeneralOrderByModel; import com.bydan.framework.erp.presentation.desktop.swing.DateConverter; import com.bydan.framework.erp.presentation.desktop.swing.DateConverterFromDate; import com.bydan.framework.erp.presentation.desktop.swing.DateRenderer; import com.bydan.framework.erp.presentation.desktop.swing.DateEditorRenderer; import com.bydan.framework.erp.presentation.desktop.swing.BooleanRenderer; import com.bydan.framework.erp.presentation.desktop.swing.BooleanEditorRenderer; import com.bydan.framework.erp.presentation.desktop.swing.TextFieldRenderer; import com.bydan.framework.erp.presentation.desktop.swing.RunnableProceso; import com.bydan.framework.erp.presentation.desktop.swing.*; //import com.bydan.framework.erp.presentation.desktop.swing.TextFieldEditorRenderer; import com.bydan.framework.erp.presentation.desktop.swing.HeaderRenderer; import com.bydan.framework.erp.presentation.desktop.swing.JInternalFrameBase; import com.bydan.framework.erp.presentation.desktop.swing.FuncionesSwing; import com.bydan.framework.erp.presentation.desktop.swing.MainJFrame; import com.bydan.framework.erp.resources.imagenes.AuxiliarImagenes; import com.bydan.erp.inventario.resources.reportes.report.AuxiliarReportes; import com.bydan.erp.inventario.util.*; import com.bydan.erp.inventario.util.report.*; import com.bydan.erp.inventario.business.logic.report.*; import com.bydan.erp.inventario.business.logic.*; import com.bydan.erp.seguridad.business.logic.*; //EJB //PARAMETROS //EJB PARAMETROS import com.bydan.framework.erp.business.logic.*; import com.bydan.framework.erp.util.*; import com.bydan.erp.inventario.business.entity.*; import com.bydan.erp.inventario.business.entity.report.*; //import com.bydan.framework.erp.business.entity.ConexionBeanFace; //import com.bydan.framework.erp.business.entity.Mensajes; import com.bydan.erp.inventario.presentation.swing.jinternalframes.*; import com.bydan.erp.seguridad.presentation.swing.jinternalframes.*; import com.bydan.erp.inventario.presentation.swing.jinternalframes.auxiliar.*; import com.bydan.erp.seguridad.presentation.swing.jinternalframes.auxiliar.*; import javax.imageio.ImageIO; import java.net.NetworkInterface; import java.net.InterfaceAddress; import java.net.InetAddress; import javax.naming.InitialContext; import java.lang.Long; import java.util.Date; import java.util.Enumeration; import java.util.Iterator; import java.util.Set; import java.util.HashSet; import java.util.List; import java.util.ArrayList; import java.io.Serializable; import java.util.Hashtable; import java.util.Collections; import java.io.File; import java.io.FileInputStream; import java.io.BufferedWriter; import java.io.FileWriter; import java.io.FileOutputStream; import java.io.InputStream; import java.io.BufferedReader; import java.io.FileReader; import java.util.HashMap; import java.util.Map; import java.io.PrintWriter; import java.sql.SQLException; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException; import javax.xml.transform.stream.StreamSource; import org.xml.sax.EntityResolver; import org.xml.sax.InputSource; import org.xml.sax.SAXException; import org.w3c.dom.Document; import org.w3c.dom.Document; import org.w3c.dom.NodeList; import org.w3c.dom.Node; import org.w3c.dom.Element; import org.apache.poi.hssf.usermodel.HSSFCell; import org.apache.poi.hssf.usermodel.HSSFRow; import org.apache.poi.hssf.usermodel.HSSFSheet; import org.apache.poi.hssf.usermodel.HSSFWorkbook; import org.apache.poi.xssf.usermodel.XSSFWorkbook; import org.apache.poi.ss.usermodel.Workbook; import org.apache.poi.ss.usermodel.Sheet; import org.apache.poi.ss.usermodel.Row; import org.apache.poi.ss.usermodel.Cell; import org.apache.poi.ss.usermodel.CellStyle; import org.apache.poi.ss.usermodel.IndexedColors; import org.apache.poi.ss.util.CellRangeAddress; import javax.xml.transform.Transformer; import javax.xml.transform.TransformerFactory; import javax.xml.transform.dom.DOMSource; import javax.xml.transform.stream.StreamResult; //import org.hibernate.collection.PersistentBag; import net.sf.jasperreports.engine.JRException; import net.sf.jasperreports.engine.JRRuntimeException; import net.sf.jasperreports.engine.JasperFillManager; import net.sf.jasperreports.engine.JasperPrint; import net.sf.jasperreports.engine.JasperReport; import net.sf.jasperreports.engine.util.JRLoader; import net.sf.jasperreports.engine.export.JRHtmlExporter; import net.sf.jasperreports.j2ee.servlets.BaseHttpServlet; import net.sf.jasperreports.engine.JRExporterParameter; import net.sf.jasperreports.engine.data.JRBeanArrayDataSource; import net.sf.jasperreports.engine.data.JRBeanCollectionDataSource; import net.sf.jasperreports.view.JasperViewer; import org.apache.log4j.Logger; import com.bydan.framework.erp.business.entity.Reporte; //VALIDACION import org.hibernate.validator.ClassValidator; import org.hibernate.validator.InvalidValue; import net.sf.jasperreports.engine.JREmptyDataSource; import net.sf.jasperreports.engine.JasperCompileManager; import net.sf.jasperreports.engine.JasperExportManager; import net.sf.jasperreports.engine.JasperPrint; import net.sf.jasperreports.engine.JasperPrintManager; import net.sf.jasperreports.engine.JasperReport; import net.sf.jasperreports.engine.JasperRunManager; import net.sf.jasperreports.engine.export.JExcelApiExporter; import net.sf.jasperreports.engine.export.JRCsvExporter; import net.sf.jasperreports.engine.export.JRRtfExporter; import net.sf.jasperreports.engine.export.JRXlsExporter; import net.sf.jasperreports.engine.export.JRXlsExporterParameter; import net.sf.jasperreports.engine.util.JRSaver; import net.sf.jasperreports.engine.xml.JRXmlWriter; import com.bydan.erp.inventario.presentation.web.jsf.sessionbean.*; import com.bydan.erp.inventario.presentation.web.jsf.sessionbean.report.*; import java.util.EventObject; import javax.swing.*; import javax.swing.border.Border; import javax.swing.border.TitledBorder; import javax.swing.border.EmptyBorder; import javax.swing.event.*; import javax.swing.table.AbstractTableModel; import javax.swing.table.DefaultTableCellRenderer; import javax.swing.table.TableColumn; import javax.swing.table.TableCellEditor; import javax.swing.table.TableCellRenderer; import java.awt.*; import java.awt.event.*; import org.jdesktop.beansbinding.Binding.SyncFailure; import org.jdesktop.beansbinding.BindingListener; import org.jdesktop.beansbinding.Bindings; import org.jdesktop.beansbinding.BeanProperty; import org.jdesktop.beansbinding.ELProperty; import org.jdesktop.beansbinding.AutoBinding.UpdateStrategy; import org.jdesktop.beansbinding.PropertyStateEvent; import org.jdesktop.swingbinding.JComboBoxBinding; import org.jdesktop.swingbinding.SwingBindings; import java.beans.PropertyChangeListener; import java.beans.PropertyChangeEvent; import com.toedter.calendar.JDateChooser; import com.bydan.erp.inventario.business.entity.*; import com.bydan.erp.seguridad.business.entity.*; import com.bydan.erp.inventario.util.*; import com.bydan.erp.seguridad.util.*; import com.bydan.erp.inventario.presentation.web.jsf.sessionbean.*; import com.bydan.erp.seguridad.presentation.web.jsf.sessionbean.*; @SuppressWarnings("unused") public class ProcesoPreciosPorcentajeBeanSwingJInternalFrame extends ProcesoPreciosPorcentajeJInternalFrame implements WindowListener,WindowFocusListener { public static final long serialVersionUID = 1L; public static Logger logger = Logger.getLogger(ProcesoPreciosPorcentajeBeanSwingJInternalFrame.class); public static ClassValidator<ProcesoPreciosPorcentaje> procesopreciosporcentajeValidator = new ClassValidator<ProcesoPreciosPorcentaje>(ProcesoPreciosPorcentaje.class); public InvalidValue[] invalidValues=null; //Ejb Foreign Keys public ProcesoPreciosPorcentaje procesopreciosporcentaje; public ProcesoPreciosPorcentaje procesopreciosporcentajeAux; public ProcesoPreciosPorcentaje procesopreciosporcentajeAnterior;//USADO PARA MANEJAR FOCUS GAINED,LOST public ProcesoPreciosPorcentaje procesopreciosporcentajeTotales; public Long idProcesoPreciosPorcentajeActual; public Long iIdNuevoProcesoPreciosPorcentaje=0L; public int rowIndexActual=0; public String sFinalQueryComboBodega=""; public List<Bodega> bodegasForeignKey; public List<Bodega> getbodegasForeignKey() { return bodegasForeignKey; } public void setbodegasForeignKey(List<Bodega> bodegasForeignKey) { this.bodegasForeignKey = bodegasForeignKey; } //OBJETO FK ACTUAL public Bodega bodegaForeignKey; public Bodega getbodegaForeignKey() { return bodegaForeignKey; } public void setbodegaForeignKey(Bodega bodegaForeignKey) { this.bodegaForeignKey = bodegaForeignKey; } public String sFinalQueryComboProducto=""; public List<Producto> productosForeignKey; public List<Producto> getproductosForeignKey() { return productosForeignKey; } public void setproductosForeignKey(List<Producto> productosForeignKey) { this.productosForeignKey = productosForeignKey; } //OBJETO FK ACTUAL public Producto productoForeignKey; public Producto getproductoForeignKey() { return productoForeignKey; } public void setproductoForeignKey(Producto productoForeignKey) { this.productoForeignKey = productoForeignKey; } public String sFinalQueryComboEmpresa=""; public List<Empresa> empresasForeignKey; public List<Empresa> getempresasForeignKey() { return empresasForeignKey; } public void setempresasForeignKey(List<Empresa> empresasForeignKey) { this.empresasForeignKey = empresasForeignKey; } //OBJETO FK ACTUAL public Empresa empresaForeignKey; public Empresa getempresaForeignKey() { return empresaForeignKey; } public void setempresaForeignKey(Empresa empresaForeignKey) { this.empresaForeignKey = empresaForeignKey; } public String sFinalQueryComboSucursal=""; public List<Sucursal> sucursalsForeignKey; public List<Sucursal> getsucursalsForeignKey() { return sucursalsForeignKey; } public void setsucursalsForeignKey(List<Sucursal> sucursalsForeignKey) { this.sucursalsForeignKey = sucursalsForeignKey; } //OBJETO FK ACTUAL public Sucursal sucursalForeignKey; public Sucursal getsucursalForeignKey() { return sucursalForeignKey; } public void setsucursalForeignKey(Sucursal sucursalForeignKey) { this.sucursalForeignKey = sucursalForeignKey; } public String sFinalQueryComboLinea=""; public List<Linea> lineasForeignKey; public List<Linea> getlineasForeignKey() { return lineasForeignKey; } public void setlineasForeignKey(List<Linea> lineasForeignKey) { this.lineasForeignKey = lineasForeignKey; } //OBJETO FK ACTUAL public Linea lineaForeignKey; public Linea getlineaForeignKey() { return lineaForeignKey; } public void setlineaForeignKey(Linea lineaForeignKey) { this.lineaForeignKey = lineaForeignKey; } public String sFinalQueryComboLineaGrupo=""; public List<Linea> lineagruposForeignKey; public List<Linea> getlineagruposForeignKey() { return lineagruposForeignKey; } public void setlineagruposForeignKey(List<Linea> lineagruposForeignKey) { this.lineagruposForeignKey = lineagruposForeignKey; } //OBJETO FK ACTUAL public Linea lineagrupoForeignKey; public Linea getlineagrupoForeignKey() { return lineagrupoForeignKey; } public void setlineagrupoForeignKey(Linea lineagrupoForeignKey) { this.lineagrupoForeignKey = lineagrupoForeignKey; } public String sFinalQueryComboLineaCategoria=""; public List<Linea> lineacategoriasForeignKey; public List<Linea> getlineacategoriasForeignKey() { return lineacategoriasForeignKey; } public void setlineacategoriasForeignKey(List<Linea> lineacategoriasForeignKey) { this.lineacategoriasForeignKey = lineacategoriasForeignKey; } //OBJETO FK ACTUAL public Linea lineacategoriaForeignKey; public Linea getlineacategoriaForeignKey() { return lineacategoriaForeignKey; } public void setlineacategoriaForeignKey(Linea lineacategoriaForeignKey) { this.lineacategoriaForeignKey = lineacategoriaForeignKey; } public String sFinalQueryComboLineaMarca=""; public List<Linea> lineamarcasForeignKey; public List<Linea> getlineamarcasForeignKey() { return lineamarcasForeignKey; } public void setlineamarcasForeignKey(List<Linea> lineamarcasForeignKey) { this.lineamarcasForeignKey = lineamarcasForeignKey; } //OBJETO FK ACTUAL public Linea lineamarcaForeignKey; public Linea getlineamarcaForeignKey() { return lineamarcaForeignKey; } public void setlineamarcaForeignKey(Linea lineamarcaForeignKey) { this.lineamarcaForeignKey = lineamarcaForeignKey; } //FALTA:PARA BUSQUEDAS POR CAMPO EN FORMULARIO public String sFinalQueryGeneral=""; public Boolean isEntroOnLoad=false; public Boolean isErrorGuardar=false; public Boolean isGuardarCambiosEnLote=false; public Boolean isCargarCombosDependencia=false; public Boolean isSeleccionarTodos=false; public Boolean isSeleccionados=false; public Boolean conGraficoReporte=false; public Boolean isPostAccionNuevo=false; public Boolean isPostAccionSinCerrar=false; public Boolean isPostAccionSinMensaje=false; public Boolean esControlTabla=false; public Boolean isPermisoTodoProcesoPreciosPorcentaje; public Boolean isPermisoNuevoProcesoPreciosPorcentaje; public Boolean isPermisoActualizarProcesoPreciosPorcentaje; public Boolean isPermisoActualizarOriginalProcesoPreciosPorcentaje; public Boolean isPermisoEliminarProcesoPreciosPorcentaje; public Boolean isPermisoGuardarCambiosProcesoPreciosPorcentaje; public Boolean isPermisoConsultaProcesoPreciosPorcentaje; public Boolean isPermisoBusquedaProcesoPreciosPorcentaje; public Boolean isPermisoReporteProcesoPreciosPorcentaje; public Boolean isPermisoPaginacionMedioProcesoPreciosPorcentaje; public Boolean isPermisoPaginacionAltoProcesoPreciosPorcentaje; public Boolean isPermisoPaginacionTodoProcesoPreciosPorcentaje; public Boolean isPermisoCopiarProcesoPreciosPorcentaje; public Boolean isPermisoVerFormProcesoPreciosPorcentaje; public Boolean isPermisoDuplicarProcesoPreciosPorcentaje; public Boolean isPermisoOrdenProcesoPreciosPorcentaje; public ArrayList<DatoGeneral> arrDatoGeneral; public ArrayList<String> arrDatoGeneralNo; ArrayList<Classe> classesActual=new ArrayList<Classe>(); public List<Accion> accions; public List<Accion> accionsFormulario; public ArrayList<DatoGeneralMinimo> arrDatoGeneralMinimos; public ArrayList<Reporte> tiposArchivosReportes; public ArrayList<Reporte> tiposArchivosReportesDinamico; public ArrayList<Reporte> tiposReportes; public ArrayList<Reporte> tiposReportesDinamico; public ArrayList<Reporte> tiposGraficosReportes; public ArrayList<Reporte> tiposPaginacion; public ArrayList<Reporte> tiposRelaciones; public ArrayList<Reporte> tiposAcciones; public ArrayList<Reporte> tiposAccionesFormulario; public ArrayList<Reporte> tiposSeleccionar; public ArrayList<Reporte> tiposColumnasSelect; public ArrayList<Reporte> tiposRelacionesSelect; public Integer iNumeroPaginacion; public Integer iNumeroPaginacionPagina; public Pagination pagination; public DatosCliente datosCliente; public DatosDeep datosDeep; public String sTipoArchivoReporte=""; public String sTipoArchivoReporteDinamico=""; public String sTipoReporte=""; public String sTipoReporteDinamico=""; public String sTipoGraficoReporte=""; public String sTipoPaginacion=""; public String sTipoRelacion=""; public String sTipoAccion=""; public String sTipoAccionFormulario=""; public String sTipoSeleccionar=""; public String sDetalleReporte=""; public Boolean isMostrarNumeroPaginacion; public String sTipoReporteExtra=""; public String sValorCampoGeneral=""; public Boolean esReporteDinamico=false; public Boolean esReporteAccionProceso=false; public Boolean esRecargarFks=false; public String sPathReporteDinamico=""; public ProcesoPreciosPorcentajeParameterReturnGeneral procesopreciosporcentajeReturnGeneral; public ProcesoPreciosPorcentajeParameterReturnGeneral procesopreciosporcentajeParameterGeneral; public JasperPrint jasperPrint = null; public Long lIdUsuarioSesion=0L; public Boolean isEsNuevoProcesoPreciosPorcentaje=false; public Boolean esParaAccionDesdeFormularioProcesoPreciosPorcentaje=false; public Boolean isEsMantenimientoRelacionesRelacionadoUnico=false; public Boolean isEsMantenimientoRelaciones=false; public Boolean isEsMantenimientoRelacionado=false; public Boolean isContieneImagenes=false; //public Boolean conTotales=false; //Viene heredado de JInternalFrameBase //public Boolean esParaBusquedaForeignKey=false; protected ProcesoPreciosPorcentajeSessionBeanAdditional procesopreciosporcentajeSessionBeanAdditional=null; public ProcesoPreciosPorcentajeSessionBeanAdditional getProcesoPreciosPorcentajeSessionBeanAdditional() { return this.procesopreciosporcentajeSessionBeanAdditional; } public void setProcesoPreciosPorcentajeSessionBeanAdditional(ProcesoPreciosPorcentajeSessionBeanAdditional procesopreciosporcentajeSessionBeanAdditional) { try { this.procesopreciosporcentajeSessionBeanAdditional=procesopreciosporcentajeSessionBeanAdditional; } catch(Exception e) { ; } } protected ProcesoPreciosPorcentajeBeanSwingJInternalFrameAdditional procesopreciosporcentajeBeanSwingJInternalFrameAdditional=null; //public class ProcesoPreciosPorcentajeBeanSwingJInternalFrame public ProcesoPreciosPorcentajeBeanSwingJInternalFrameAdditional getProcesoPreciosPorcentajeBeanSwingJInternalFrameAdditional() { return this.procesopreciosporcentajeBeanSwingJInternalFrameAdditional; } public void setProcesoPreciosPorcentajeBeanSwingJInternalFrameAdditional(ProcesoPreciosPorcentajeBeanSwingJInternalFrameAdditional procesopreciosporcentajeBeanSwingJInternalFrameAdditional) { try { this.procesopreciosporcentajeBeanSwingJInternalFrameAdditional=procesopreciosporcentajeBeanSwingJInternalFrameAdditional; } catch(Exception e) { ; } } //ESTA EN PADRE //public ProcesoPreciosPorcentajeLogic procesopreciosporcentajeLogic; public SistemaLogicAdditional sistemaLogicAdditional; public ProcesoPreciosPorcentaje procesopreciosporcentajeBean; public ProcesoPreciosPorcentajeConstantesFunciones procesopreciosporcentajeConstantesFunciones; //public ProcesoPreciosPorcentajeParameterReturnGeneral procesopreciosporcentajeReturnGeneral; //FK public BodegaLogic bodegaLogic; public ProductoLogic productoLogic; public EmpresaLogic empresaLogic; public SucursalLogic sucursalLogic; public LineaLogic lineaLogic; public LineaLogic lineagrupoLogic; public LineaLogic lineacategoriaLogic; public LineaLogic lineamarcaLogic; //PARAMETROS //public List<ProcesoPreciosPorcentaje> procesopreciosporcentajes; //public List<ProcesoPreciosPorcentaje> procesopreciosporcentajesEliminados; //public List<ProcesoPreciosPorcentaje> procesopreciosporcentajesAux; public String sAccionMantenimiento=""; public String sAccionBusqueda=""; public String sAccionAdicional=""; public String sUltimaBusqueda=""; public Mensaje mensaje; public String sVisibilidadTablaBusquedas=""; public String sVisibilidadTablaElementos=""; public String sVisibilidadTablaAcciones=""; public Boolean isVisibilidadCeldaNuevoProcesoPreciosPorcentaje=false; public Boolean isVisibilidadCeldaDuplicarProcesoPreciosPorcentaje=true; public Boolean isVisibilidadCeldaCopiarProcesoPreciosPorcentaje=true; public Boolean isVisibilidadCeldaVerFormProcesoPreciosPorcentaje=true; public Boolean isVisibilidadCeldaOrdenProcesoPreciosPorcentaje=true; public Boolean isVisibilidadCeldaNuevoRelacionesProcesoPreciosPorcentaje=false; public Boolean isVisibilidadCeldaModificarProcesoPreciosPorcentaje=false; public Boolean isVisibilidadCeldaActualizarProcesoPreciosPorcentaje=false; public Boolean isVisibilidadCeldaEliminarProcesoPreciosPorcentaje=false; public Boolean isVisibilidadCeldaCancelarProcesoPreciosPorcentaje=false; public Boolean isVisibilidadCeldaGuardarProcesoPreciosPorcentaje=false; public Boolean isVisibilidadCeldaGuardarCambiosProcesoPreciosPorcentaje=false; public Boolean isVisibilidadBusquedaProcesoPreciosPorcentaje=false; public Boolean isVisibilidadFK_IdBodega=false; public Boolean isVisibilidadFK_IdEmpresa=false; public Boolean isVisibilidadFK_IdLinea=false; public Boolean isVisibilidadFK_IdLineaCategoria=false; public Boolean isVisibilidadFK_IdLineaGrupo=false; public Boolean isVisibilidadFK_IdLineaMarca=false; public Boolean isVisibilidadFK_IdProducto=false; public Boolean isVisibilidadFK_IdSucursal=false; public Long getiIdNuevoProcesoPreciosPorcentaje() { return this.iIdNuevoProcesoPreciosPorcentaje; } public void setiIdNuevoProcesoPreciosPorcentaje(Long iIdNuevoProcesoPreciosPorcentaje) { this.iIdNuevoProcesoPreciosPorcentaje = iIdNuevoProcesoPreciosPorcentaje; } public Long getidProcesoPreciosPorcentajeActual() { return this.idProcesoPreciosPorcentajeActual; } public void setidProcesoPreciosPorcentajeActual(Long idProcesoPreciosPorcentajeActual) { this.idProcesoPreciosPorcentajeActual = idProcesoPreciosPorcentajeActual; } public int getrowIndexActual() { return this.rowIndexActual; } public void setrowIndexActual(int rowIndexActual) { this.rowIndexActual=rowIndexActual; } public ProcesoPreciosPorcentaje getprocesopreciosporcentaje() { return this.procesopreciosporcentaje; } public void setprocesopreciosporcentaje(ProcesoPreciosPorcentaje procesopreciosporcentaje) { this.procesopreciosporcentaje = procesopreciosporcentaje; } public ProcesoPreciosPorcentaje getprocesopreciosporcentajeAux() { return this.procesopreciosporcentajeAux; } public void setprocesopreciosporcentajeAux(ProcesoPreciosPorcentaje procesopreciosporcentajeAux) { this.procesopreciosporcentajeAux = procesopreciosporcentajeAux; } public ProcesoPreciosPorcentaje getprocesopreciosporcentajeAnterior() { return this.procesopreciosporcentajeAnterior; } public void setprocesopreciosporcentajeAnterior(ProcesoPreciosPorcentaje procesopreciosporcentajeAnterior) { this.procesopreciosporcentajeAnterior = procesopreciosporcentajeAnterior; } public ProcesoPreciosPorcentaje getprocesopreciosporcentajeTotales() { return this.procesopreciosporcentajeTotales; } public void setprocesopreciosporcentajeTotales(ProcesoPreciosPorcentaje procesopreciosporcentajeTotales) { this.procesopreciosporcentajeTotales = procesopreciosporcentajeTotales; } public ProcesoPreciosPorcentaje getprocesopreciosporcentajeBean() { return this.procesopreciosporcentajeBean; } public void setprocesopreciosporcentajeBean(ProcesoPreciosPorcentaje procesopreciosporcentajeBean) { this.procesopreciosporcentajeBean = procesopreciosporcentajeBean; } public ProcesoPreciosPorcentajeParameterReturnGeneral getprocesopreciosporcentajeReturnGeneral() { return this.procesopreciosporcentajeReturnGeneral; } public void setprocesopreciosporcentajeReturnGeneral(ProcesoPreciosPorcentajeParameterReturnGeneral procesopreciosporcentajeReturnGeneral) { this.procesopreciosporcentajeReturnGeneral = procesopreciosporcentajeReturnGeneral; } public Long id_bodegaBusquedaProcesoPreciosPorcentaje=-1L; public Long getid_bodegaBusquedaProcesoPreciosPorcentaje() { return this.id_bodegaBusquedaProcesoPreciosPorcentaje; } public void setid_bodegaBusquedaProcesoPreciosPorcentaje(Long id_bodegaBusquedaProcesoPreciosPorcentaje) { this.id_bodegaBusquedaProcesoPreciosPorcentaje = id_bodegaBusquedaProcesoPreciosPorcentaje; } ; public Long id_productoBusquedaProcesoPreciosPorcentaje=-1L; public Long getid_productoBusquedaProcesoPreciosPorcentaje() { return this.id_productoBusquedaProcesoPreciosPorcentaje; } public void setid_productoBusquedaProcesoPreciosPorcentaje(Long id_productoBusquedaProcesoPreciosPorcentaje) { this.id_productoBusquedaProcesoPreciosPorcentaje = id_productoBusquedaProcesoPreciosPorcentaje; } ; public Long id_lineaBusquedaProcesoPreciosPorcentaje=-1L; public Long getid_lineaBusquedaProcesoPreciosPorcentaje() { return this.id_lineaBusquedaProcesoPreciosPorcentaje; } public void setid_lineaBusquedaProcesoPreciosPorcentaje(Long id_lineaBusquedaProcesoPreciosPorcentaje) { this.id_lineaBusquedaProcesoPreciosPorcentaje = id_lineaBusquedaProcesoPreciosPorcentaje; } ; public Long id_linea_grupoBusquedaProcesoPreciosPorcentaje=-1L; public Long getid_linea_grupoBusquedaProcesoPreciosPorcentaje() { return this.id_linea_grupoBusquedaProcesoPreciosPorcentaje; } public void setid_linea_grupoBusquedaProcesoPreciosPorcentaje(Long id_linea_grupoBusquedaProcesoPreciosPorcentaje) { this.id_linea_grupoBusquedaProcesoPreciosPorcentaje = id_linea_grupoBusquedaProcesoPreciosPorcentaje; } ; public Long id_linea_categoriaBusquedaProcesoPreciosPorcentaje=-1L; public Long getid_linea_categoriaBusquedaProcesoPreciosPorcentaje() { return this.id_linea_categoriaBusquedaProcesoPreciosPorcentaje; } public void setid_linea_categoriaBusquedaProcesoPreciosPorcentaje(Long id_linea_categoriaBusquedaProcesoPreciosPorcentaje) { this.id_linea_categoriaBusquedaProcesoPreciosPorcentaje = id_linea_categoriaBusquedaProcesoPreciosPorcentaje; } ; public Long id_linea_marcaBusquedaProcesoPreciosPorcentaje=-1L; public Long getid_linea_marcaBusquedaProcesoPreciosPorcentaje() { return this.id_linea_marcaBusquedaProcesoPreciosPorcentaje; } public void setid_linea_marcaBusquedaProcesoPreciosPorcentaje(Long id_linea_marcaBusquedaProcesoPreciosPorcentaje) { this.id_linea_marcaBusquedaProcesoPreciosPorcentaje = id_linea_marcaBusquedaProcesoPreciosPorcentaje; } public Long id_bodegaFK_IdBodega=-1L; public Long getid_bodegaFK_IdBodega() { return this.id_bodegaFK_IdBodega; } public void setid_bodegaFK_IdBodega(Long id_bodegaFK_IdBodega) { this.id_bodegaFK_IdBodega = id_bodegaFK_IdBodega; } public Long id_empresaFK_IdEmpresa=-1L; public Long getid_empresaFK_IdEmpresa() { return this.id_empresaFK_IdEmpresa; } public void setid_empresaFK_IdEmpresa(Long id_empresaFK_IdEmpresa) { this.id_empresaFK_IdEmpresa = id_empresaFK_IdEmpresa; } public Long id_lineaFK_IdLinea=-1L; public Long getid_lineaFK_IdLinea() { return this.id_lineaFK_IdLinea; } public void setid_lineaFK_IdLinea(Long id_lineaFK_IdLinea) { this.id_lineaFK_IdLinea = id_lineaFK_IdLinea; } public Long id_linea_categoriaFK_IdLineaCategoria=-1L; public Long getid_linea_categoriaFK_IdLineaCategoria() { return this.id_linea_categoriaFK_IdLineaCategoria; } public void setid_linea_categoriaFK_IdLineaCategoria(Long id_linea_categoriaFK_IdLineaCategoria) { this.id_linea_categoriaFK_IdLineaCategoria = id_linea_categoriaFK_IdLineaCategoria; } public Long id_linea_grupoFK_IdLineaGrupo=-1L; public Long getid_linea_grupoFK_IdLineaGrupo() { return this.id_linea_grupoFK_IdLineaGrupo; } public void setid_linea_grupoFK_IdLineaGrupo(Long id_linea_grupoFK_IdLineaGrupo) { this.id_linea_grupoFK_IdLineaGrupo = id_linea_grupoFK_IdLineaGrupo; } public Long id_linea_marcaFK_IdLineaMarca=-1L; public Long getid_linea_marcaFK_IdLineaMarca() { return this.id_linea_marcaFK_IdLineaMarca; } public void setid_linea_marcaFK_IdLineaMarca(Long id_linea_marcaFK_IdLineaMarca) { this.id_linea_marcaFK_IdLineaMarca = id_linea_marcaFK_IdLineaMarca; } public Long id_productoFK_IdProducto=-1L; public Long getid_productoFK_IdProducto() { return this.id_productoFK_IdProducto; } public void setid_productoFK_IdProducto(Long id_productoFK_IdProducto) { this.id_productoFK_IdProducto = id_productoFK_IdProducto; } public Long id_sucursalFK_IdSucursal=-1L; public Long getid_sucursalFK_IdSucursal() { return this.id_sucursalFK_IdSucursal; } public void setid_sucursalFK_IdSucursal(Long id_sucursalFK_IdSucursal) { this.id_sucursalFK_IdSucursal = id_sucursalFK_IdSucursal; } //ELEMENTOS TABLAS PARAMETOS //ELEMENTOS TABLAS PARAMETOS_FIN public ProcesoPreciosPorcentajeLogic getProcesoPreciosPorcentajeLogic() { return procesopreciosporcentajeLogic; } public void setProcesoPreciosPorcentajeLogic(ProcesoPreciosPorcentajeLogic procesopreciosporcentajeLogic) { this.procesopreciosporcentajeLogic = procesopreciosporcentajeLogic; } public void setsFinalQueryGeneral(String sFinalQueryGeneral) { this.sFinalQueryGeneral=sFinalQueryGeneral; } public String getsFinalQueryGeneral() { return this.sFinalQueryGeneral; } public Boolean getIsGuardarCambiosEnLote() { return isGuardarCambiosEnLote; } public void setIsGuardarCambiosEnLote(Boolean isGuardarCambiosEnLote) { this.isGuardarCambiosEnLote = isGuardarCambiosEnLote; } public Boolean getIsCargarCombosDependencia() { return isCargarCombosDependencia; } public void setIsCargarCombosDependencia(Boolean isCargarCombosDependencia) { this.isCargarCombosDependencia = isCargarCombosDependencia; } public Boolean getIsEsNuevoProcesoPreciosPorcentaje() { return isEsNuevoProcesoPreciosPorcentaje; } public void setIsEsNuevoProcesoPreciosPorcentaje(Boolean isEsNuevoProcesoPreciosPorcentaje) { this.isEsNuevoProcesoPreciosPorcentaje = isEsNuevoProcesoPreciosPorcentaje; } public Boolean getEsParaAccionDesdeFormularioProcesoPreciosPorcentaje() { return esParaAccionDesdeFormularioProcesoPreciosPorcentaje; } public void setEsParaAccionDesdeFormularioProcesoPreciosPorcentaje(Boolean esParaAccionDesdeFormularioProcesoPreciosPorcentaje) { this.esParaAccionDesdeFormularioProcesoPreciosPorcentaje = esParaAccionDesdeFormularioProcesoPreciosPorcentaje; } public Boolean getIsEsMantenimientoRelacionesRelacionadoUnico() { return isEsMantenimientoRelacionesRelacionadoUnico; } public void setIsEsMantenimientoRelacionesRelacionadoUnico(Boolean isEsMantenimientoRelacionesRelacionadoUnico) { this.isEsMantenimientoRelacionesRelacionadoUnico = isEsMantenimientoRelacionesRelacionadoUnico; } public Boolean getIsEsMantenimientoRelaciones() { return isEsMantenimientoRelaciones; } public void setIsEsMantenimientoRelaciones(Boolean isEsMantenimientoRelaciones) { this.isEsMantenimientoRelaciones = isEsMantenimientoRelaciones; } public Boolean getIsEsMantenimientoRelacionado() { return isEsMantenimientoRelacionado; } public void setIsEsMantenimientoRelacionado(Boolean isEsMantenimientoRelacionado) { this.isEsMantenimientoRelacionado = isEsMantenimientoRelacionado; } public Boolean getesParaBusquedaForeignKey() { return esParaBusquedaForeignKey; } public void setesParaBusquedaForeignKey(Boolean esParaBusquedaForeignKey) { this.esParaBusquedaForeignKey = esParaBusquedaForeignKey; } public Boolean getIsContieneImagenes() { return isContieneImagenes; } public void setIsContieneImagenes(Boolean isContieneImagenes) { this.isContieneImagenes = isContieneImagenes; } public void cargarCombosBodegasForeignKeyLista(String sFinalQuery)throws Exception { try { this.bodegasForeignKey=new ArrayList<Bodega>(); ArrayList<Classe> clases=new ArrayList<Classe>(); ArrayList<String> arrClasses=new ArrayList<String>(); Classe classe=new Classe(); DatosDeep datosDeep=new DatosDeep(false,DeepLoadType.INCLUDE,clases,""); BodegaLogic bodegaLogic=new BodegaLogic(); bodegaLogic.getBodegaDataAccess().setIsForForeingKeyData(true); if(this.procesopreciosporcentajeSessionBean==null) { this.procesopreciosporcentajeSessionBean=new ProcesoPreciosPorcentajeSessionBean(); } if(!this.procesopreciosporcentajeSessionBean.getisBusquedaDesdeForeignKeySesionBodega()) { //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { bodegaLogic.getBodegaDataAccess().setIsForForeingKeyData(true); bodegaLogic.getTodosBodegasWithConnection(sFinalQuery,new Pagination()); this.bodegasForeignKey=bodegaLogic.getBodegas(); } else if(Constantes.ISUSAEJBREMOTE) { } else if(Constantes.ISUSAEJBHOME) { } //ARCHITECTURE } else { if(!this.conCargarMinimo) { this.setVisibilidadBusquedasParaBodega(true); } //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { bodegaLogic.getEntityWithConnection(procesopreciosporcentajeSessionBean.getlidBodegaActual()); this.bodegasForeignKey.add(bodegaLogic.getBodega()); } else if(Constantes.ISUSAEJBREMOTE) { } else if(Constantes.ISUSAEJBHOME) { } //ARCHITECTURE } } catch(Exception e) { throw e; } } public void cargarCombosProductosForeignKeyLista(String sFinalQuery)throws Exception { try { this.productosForeignKey=new ArrayList<Producto>(); ArrayList<Classe> clases=new ArrayList<Classe>(); ArrayList<String> arrClasses=new ArrayList<String>(); Classe classe=new Classe(); DatosDeep datosDeep=new DatosDeep(false,DeepLoadType.INCLUDE,clases,""); ProductoLogic productoLogic=new ProductoLogic(); productoLogic.getProductoDataAccess().setIsForForeingKeyData(true); if(this.procesopreciosporcentajeSessionBean==null) { this.procesopreciosporcentajeSessionBean=new ProcesoPreciosPorcentajeSessionBean(); } if(!this.procesopreciosporcentajeSessionBean.getisBusquedaDesdeForeignKeySesionProducto()) { //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { productoLogic.getProductoDataAccess().setIsForForeingKeyData(true); productoLogic.getTodosProductosWithConnection(sFinalQuery,new Pagination()); this.productosForeignKey=productoLogic.getProductos(); } else if(Constantes.ISUSAEJBREMOTE) { } else if(Constantes.ISUSAEJBHOME) { } //ARCHITECTURE } else { if(!this.conCargarMinimo) { this.setVisibilidadBusquedasParaProducto(true); } //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { productoLogic.getEntityWithConnection(procesopreciosporcentajeSessionBean.getlidProductoActual()); this.productosForeignKey.add(productoLogic.getProducto()); } else if(Constantes.ISUSAEJBREMOTE) { } else if(Constantes.ISUSAEJBHOME) { } //ARCHITECTURE } } catch(Exception e) { throw e; } } public void cargarCombosEmpresasForeignKeyLista(String sFinalQuery)throws Exception { try { this.empresasForeignKey=new ArrayList<Empresa>(); ArrayList<Classe> clases=new ArrayList<Classe>(); ArrayList<String> arrClasses=new ArrayList<String>(); Classe classe=new Classe(); DatosDeep datosDeep=new DatosDeep(false,DeepLoadType.INCLUDE,clases,""); EmpresaLogic empresaLogic=new EmpresaLogic(); //empresaLogic.getEmpresaDataAccess().setIsForForeingKeyData(true); if(this.procesopreciosporcentajeSessionBean==null) { this.procesopreciosporcentajeSessionBean=new ProcesoPreciosPorcentajeSessionBean(); } if(!this.procesopreciosporcentajeSessionBean.getisBusquedaDesdeForeignKeySesionEmpresa()) { //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { //empresaLogic.getEmpresaDataAccess().setIsForForeingKeyData(true); empresaLogic.getTodosEmpresasWithConnection(sFinalQuery,new Pagination()); this.empresasForeignKey=empresaLogic.getEmpresas(); } else if(Constantes.ISUSAEJBREMOTE) { } else if(Constantes.ISUSAEJBHOME) { } //ARCHITECTURE } else { if(!this.conCargarMinimo) { this.setVisibilidadBusquedasParaEmpresa(true); } //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { empresaLogic.getEntityWithConnection(procesopreciosporcentajeSessionBean.getlidEmpresaActual()); this.empresasForeignKey.add(empresaLogic.getEmpresa()); } else if(Constantes.ISUSAEJBREMOTE) { } else if(Constantes.ISUSAEJBHOME) { } //ARCHITECTURE } } catch(Exception e) { throw e; } } public void cargarCombosSucursalsForeignKeyLista(String sFinalQuery)throws Exception { try { this.sucursalsForeignKey=new ArrayList<Sucursal>(); ArrayList<Classe> clases=new ArrayList<Classe>(); ArrayList<String> arrClasses=new ArrayList<String>(); Classe classe=new Classe(); DatosDeep datosDeep=new DatosDeep(false,DeepLoadType.INCLUDE,clases,""); SucursalLogic sucursalLogic=new SucursalLogic(); //sucursalLogic.getSucursalDataAccess().setIsForForeingKeyData(true); if(this.procesopreciosporcentajeSessionBean==null) { this.procesopreciosporcentajeSessionBean=new ProcesoPreciosPorcentajeSessionBean(); } if(!this.procesopreciosporcentajeSessionBean.getisBusquedaDesdeForeignKeySesionSucursal()) { //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { //sucursalLogic.getSucursalDataAccess().setIsForForeingKeyData(true); sucursalLogic.getTodosSucursalsWithConnection(sFinalQuery,new Pagination()); this.sucursalsForeignKey=sucursalLogic.getSucursals(); } else if(Constantes.ISUSAEJBREMOTE) { } else if(Constantes.ISUSAEJBHOME) { } //ARCHITECTURE } else { if(!this.conCargarMinimo) { this.setVisibilidadBusquedasParaSucursal(true); } //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { sucursalLogic.getEntityWithConnection(procesopreciosporcentajeSessionBean.getlidSucursalActual()); this.sucursalsForeignKey.add(sucursalLogic.getSucursal()); } else if(Constantes.ISUSAEJBREMOTE) { } else if(Constantes.ISUSAEJBHOME) { } //ARCHITECTURE } } catch(Exception e) { throw e; } } public void cargarCombosLineasForeignKeyLista(String sFinalQuery)throws Exception { try { this.lineasForeignKey=new ArrayList<Linea>(); ArrayList<Classe> clases=new ArrayList<Classe>(); ArrayList<String> arrClasses=new ArrayList<String>(); Classe classe=new Classe(); DatosDeep datosDeep=new DatosDeep(false,DeepLoadType.INCLUDE,clases,""); LineaLogic lineaLogic=new LineaLogic(); //lineaLogic.getLineaDataAccess().setIsForForeingKeyData(true); if(this.procesopreciosporcentajeSessionBean==null) { this.procesopreciosporcentajeSessionBean=new ProcesoPreciosPorcentajeSessionBean(); } if(!this.procesopreciosporcentajeSessionBean.getisBusquedaDesdeForeignKeySesionLinea()) { //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { //lineaLogic.getLineaDataAccess().setIsForForeingKeyData(true); lineaLogic.getTodosLineasWithConnection(sFinalQuery,new Pagination()); this.lineasForeignKey=lineaLogic.getLineas(); } else if(Constantes.ISUSAEJBREMOTE) { } else if(Constantes.ISUSAEJBHOME) { } //ARCHITECTURE } else { if(!this.conCargarMinimo) { this.setVisibilidadBusquedasParaLinea(true); } //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { lineaLogic.getEntityWithConnection(procesopreciosporcentajeSessionBean.getlidLineaActual()); this.lineasForeignKey.add(lineaLogic.getLinea()); } else if(Constantes.ISUSAEJBREMOTE) { } else if(Constantes.ISUSAEJBHOME) { } //ARCHITECTURE } } catch(Exception e) { throw e; } } public void cargarCombosLineaGruposForeignKeyLista(String sFinalQuery)throws Exception { try { this.lineagruposForeignKey=new ArrayList<Linea>(); ArrayList<Classe> clases=new ArrayList<Classe>(); ArrayList<String> arrClasses=new ArrayList<String>(); Classe classe=new Classe(); DatosDeep datosDeep=new DatosDeep(false,DeepLoadType.INCLUDE,clases,""); LineaLogic lineaLogic=new LineaLogic(); //lineaLogic.getLineaDataAccess().setIsForForeingKeyData(true); if(this.procesopreciosporcentajeSessionBean==null) { this.procesopreciosporcentajeSessionBean=new ProcesoPreciosPorcentajeSessionBean(); } if(!this.procesopreciosporcentajeSessionBean.getisBusquedaDesdeForeignKeySesionLineaGrupo()) { //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { //lineagrupoLogic.getLineaDataAccess().setIsForForeingKeyData(true); lineaLogic.getTodosLineasWithConnection(sFinalQuery,new Pagination()); this.lineagruposForeignKey=lineaLogic.getLineas(); } else if(Constantes.ISUSAEJBREMOTE) { } else if(Constantes.ISUSAEJBHOME) { } //ARCHITECTURE } else { if(!this.conCargarMinimo) { this.setVisibilidadBusquedasParaLineaGrupo(true); } //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { lineaLogic.getEntityWithConnection(procesopreciosporcentajeSessionBean.getlidLineaGrupoActual()); this.lineagruposForeignKey.add(lineaLogic.getLinea()); } else if(Constantes.ISUSAEJBREMOTE) { } else if(Constantes.ISUSAEJBHOME) { } //ARCHITECTURE } } catch(Exception e) { throw e; } } public void cargarCombosLineaCategoriasForeignKeyLista(String sFinalQuery)throws Exception { try { this.lineacategoriasForeignKey=new ArrayList<Linea>(); ArrayList<Classe> clases=new ArrayList<Classe>(); ArrayList<String> arrClasses=new ArrayList<String>(); Classe classe=new Classe(); DatosDeep datosDeep=new DatosDeep(false,DeepLoadType.INCLUDE,clases,""); LineaLogic lineaLogic=new LineaLogic(); //lineaLogic.getLineaDataAccess().setIsForForeingKeyData(true); if(this.procesopreciosporcentajeSessionBean==null) { this.procesopreciosporcentajeSessionBean=new ProcesoPreciosPorcentajeSessionBean(); } if(!this.procesopreciosporcentajeSessionBean.getisBusquedaDesdeForeignKeySesionLineaCategoria()) { //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { //lineacategoriaLogic.getLineaDataAccess().setIsForForeingKeyData(true); lineaLogic.getTodosLineasWithConnection(sFinalQuery,new Pagination()); this.lineacategoriasForeignKey=lineaLogic.getLineas(); } else if(Constantes.ISUSAEJBREMOTE) { } else if(Constantes.ISUSAEJBHOME) { } //ARCHITECTURE } else { if(!this.conCargarMinimo) { this.setVisibilidadBusquedasParaLineaCategoria(true); } //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { lineaLogic.getEntityWithConnection(procesopreciosporcentajeSessionBean.getlidLineaCategoriaActual()); this.lineacategoriasForeignKey.add(lineaLogic.getLinea()); } else if(Constantes.ISUSAEJBREMOTE) { } else if(Constantes.ISUSAEJBHOME) { } //ARCHITECTURE } } catch(Exception e) { throw e; } } public void cargarCombosLineaMarcasForeignKeyLista(String sFinalQuery)throws Exception { try { this.lineamarcasForeignKey=new ArrayList<Linea>(); ArrayList<Classe> clases=new ArrayList<Classe>(); ArrayList<String> arrClasses=new ArrayList<String>(); Classe classe=new Classe(); DatosDeep datosDeep=new DatosDeep(false,DeepLoadType.INCLUDE,clases,""); LineaLogic lineaLogic=new LineaLogic(); //lineaLogic.getLineaDataAccess().setIsForForeingKeyData(true); if(this.procesopreciosporcentajeSessionBean==null) { this.procesopreciosporcentajeSessionBean=new ProcesoPreciosPorcentajeSessionBean(); } if(!this.procesopreciosporcentajeSessionBean.getisBusquedaDesdeForeignKeySesionLineaMarca()) { //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { //lineamarcaLogic.getLineaDataAccess().setIsForForeingKeyData(true); lineaLogic.getTodosLineasWithConnection(sFinalQuery,new Pagination()); this.lineamarcasForeignKey=lineaLogic.getLineas(); } else if(Constantes.ISUSAEJBREMOTE) { } else if(Constantes.ISUSAEJBHOME) { } //ARCHITECTURE } else { if(!this.conCargarMinimo) { this.setVisibilidadBusquedasParaLineaMarca(true); } //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { lineaLogic.getEntityWithConnection(procesopreciosporcentajeSessionBean.getlidLineaMarcaActual()); this.lineamarcasForeignKey.add(lineaLogic.getLinea()); } else if(Constantes.ISUSAEJBREMOTE) { } else if(Constantes.ISUSAEJBHOME) { } //ARCHITECTURE } } catch(Exception e) { throw e; } } public void setActualBodegaForeignKey(Long idBodegaSeleccionado,Boolean conCombosBusquedas,String sFormularioTipoBusqueda)throws Exception { try { Bodega bodegaTemp=null; for(Bodega bodegaAux:bodegasForeignKey) { if(bodegaAux.getId()!=null && bodegaAux.getId().equals(idBodegaSeleccionado)) { bodegaTemp=bodegaAux; break; } } if(sFormularioTipoBusqueda.equals("Formulario") || sFormularioTipoBusqueda.equals("Todos")){ if(bodegaTemp!=null) { if(this.procesopreciosporcentaje!=null) { this.procesopreciosporcentaje.setBodega(bodegaTemp); } if(this.jInternalFrameDetalleFormProcesoPreciosPorcentaje!=null) { this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jComboBoxid_bodegaProcesoPreciosPorcentaje.setSelectedItem(bodegaTemp); } } else { //jComboBoxid_bodegaProcesoPreciosPorcentaje.setSelectedItem(bodegaTemp); if(this.jInternalFrameDetalleFormProcesoPreciosPorcentaje!=null) { if(this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jComboBoxid_bodegaProcesoPreciosPorcentaje.getItemCount()>0) { this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jComboBoxid_bodegaProcesoPreciosPorcentaje.setSelectedIndex(0); } } } } if(conCombosBusquedas) { //BYDAN_BUSQUEDAS if(sFormularioTipoBusqueda.equals("BusquedaProcesoPreciosPorcentaje") || sFormularioTipoBusqueda.equals("Todos")){ if(bodegaTemp!=null && jComboBoxid_bodegaBusquedaProcesoPreciosPorcentajeProcesoPreciosPorcentaje!=null) { jComboBoxid_bodegaBusquedaProcesoPreciosPorcentajeProcesoPreciosPorcentaje.setSelectedItem(bodegaTemp); } else { if(jComboBoxid_bodegaBusquedaProcesoPreciosPorcentajeProcesoPreciosPorcentaje!=null) { //jComboBoxid_bodegaBusquedaProcesoPreciosPorcentajeProcesoPreciosPorcentaje.setSelectedItem(bodegaTemp); if(jComboBoxid_bodegaBusquedaProcesoPreciosPorcentajeProcesoPreciosPorcentaje.getItemCount()>0) { jComboBoxid_bodegaBusquedaProcesoPreciosPorcentajeProcesoPreciosPorcentaje.setSelectedIndex(0); } } } } } } catch(Exception e) { throw e; } } public String getActualBodegaForeignKeyDescripcion(Long idBodegaSeleccionado)throws Exception { String sDescripcion=""; try { Bodega bodegaTemp=null; for(Bodega bodegaAux:bodegasForeignKey) { if(bodegaAux.getId()!=null && bodegaAux.getId().equals(idBodegaSeleccionado)) { bodegaTemp=bodegaAux; break; } } sDescripcion=BodegaConstantesFunciones.getBodegaDescripcion(bodegaTemp); } catch(Exception e) { throw e; } return sDescripcion; } @SuppressWarnings("rawtypes") public void setActualBodegaForeignKeyGenerico(Long idBodegaSeleccionado,JComboBox jComboBoxid_bodegaProcesoPreciosPorcentajeGenerico)throws Exception { try { Bodega bodegaTemp=null; for(Bodega bodegaAux:bodegasForeignKey) { if(bodegaAux.getId()!=null && bodegaAux.getId().equals(idBodegaSeleccionado)) { bodegaTemp=bodegaAux; break; } } if(bodegaTemp!=null) { jComboBoxid_bodegaProcesoPreciosPorcentajeGenerico.setSelectedItem(bodegaTemp); } else { if(jComboBoxid_bodegaProcesoPreciosPorcentajeGenerico!=null && jComboBoxid_bodegaProcesoPreciosPorcentajeGenerico.getItemCount()>0) { jComboBoxid_bodegaProcesoPreciosPorcentajeGenerico.setSelectedIndex(0); } } } catch(Exception e) { throw e; } } public void setActualProductoForeignKey(Long idProductoSeleccionado,Boolean conCombosBusquedas,String sFormularioTipoBusqueda)throws Exception { try { Producto productoTemp=null; for(Producto productoAux:productosForeignKey) { if(productoAux.getId()!=null && productoAux.getId().equals(idProductoSeleccionado)) { productoTemp=productoAux; break; } } if(sFormularioTipoBusqueda.equals("Formulario") || sFormularioTipoBusqueda.equals("Todos")){ if(productoTemp!=null) { if(this.procesopreciosporcentaje!=null) { this.procesopreciosporcentaje.setProducto(productoTemp); } if(this.jInternalFrameDetalleFormProcesoPreciosPorcentaje!=null) { this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jComboBoxid_productoProcesoPreciosPorcentaje.setSelectedItem(productoTemp); } } else { //jComboBoxid_productoProcesoPreciosPorcentaje.setSelectedItem(productoTemp); if(this.jInternalFrameDetalleFormProcesoPreciosPorcentaje!=null) { if(this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jComboBoxid_productoProcesoPreciosPorcentaje.getItemCount()>0) { this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jComboBoxid_productoProcesoPreciosPorcentaje.setSelectedIndex(0); } } } } if(conCombosBusquedas) { //BYDAN_BUSQUEDAS if(sFormularioTipoBusqueda.equals("BusquedaProcesoPreciosPorcentaje") || sFormularioTipoBusqueda.equals("Todos")){ if(productoTemp!=null && jComboBoxid_productoBusquedaProcesoPreciosPorcentajeProcesoPreciosPorcentaje!=null) { jComboBoxid_productoBusquedaProcesoPreciosPorcentajeProcesoPreciosPorcentaje.setSelectedItem(productoTemp); } else { if(jComboBoxid_productoBusquedaProcesoPreciosPorcentajeProcesoPreciosPorcentaje!=null) { //jComboBoxid_productoBusquedaProcesoPreciosPorcentajeProcesoPreciosPorcentaje.setSelectedItem(productoTemp); if(jComboBoxid_productoBusquedaProcesoPreciosPorcentajeProcesoPreciosPorcentaje.getItemCount()>0) { jComboBoxid_productoBusquedaProcesoPreciosPorcentajeProcesoPreciosPorcentaje.setSelectedIndex(0); } } } } } } catch(Exception e) { throw e; } } public String getActualProductoForeignKeyDescripcion(Long idProductoSeleccionado)throws Exception { String sDescripcion=""; try { Producto productoTemp=null; for(Producto productoAux:productosForeignKey) { if(productoAux.getId()!=null && productoAux.getId().equals(idProductoSeleccionado)) { productoTemp=productoAux; break; } } sDescripcion=ProductoConstantesFunciones.getProductoDescripcion(productoTemp); } catch(Exception e) { throw e; } return sDescripcion; } @SuppressWarnings("rawtypes") public void setActualProductoForeignKeyGenerico(Long idProductoSeleccionado,JComboBox jComboBoxid_productoProcesoPreciosPorcentajeGenerico)throws Exception { try { Producto productoTemp=null; for(Producto productoAux:productosForeignKey) { if(productoAux.getId()!=null && productoAux.getId().equals(idProductoSeleccionado)) { productoTemp=productoAux; break; } } if(productoTemp!=null) { jComboBoxid_productoProcesoPreciosPorcentajeGenerico.setSelectedItem(productoTemp); } else { if(jComboBoxid_productoProcesoPreciosPorcentajeGenerico!=null && jComboBoxid_productoProcesoPreciosPorcentajeGenerico.getItemCount()>0) { jComboBoxid_productoProcesoPreciosPorcentajeGenerico.setSelectedIndex(0); } } } catch(Exception e) { throw e; } } public void setActualEmpresaForeignKey(Long idEmpresaSeleccionado,Boolean conCombosBusquedas,String sFormularioTipoBusqueda)throws Exception { try { Empresa empresaTemp=null; for(Empresa empresaAux:empresasForeignKey) { if(empresaAux.getId()!=null && empresaAux.getId().equals(idEmpresaSeleccionado)) { empresaTemp=empresaAux; break; } } if(sFormularioTipoBusqueda.equals("Formulario") || sFormularioTipoBusqueda.equals("Todos")){ if(empresaTemp!=null) { if(this.procesopreciosporcentaje!=null) { this.procesopreciosporcentaje.setEmpresa(empresaTemp); } if(this.jInternalFrameDetalleFormProcesoPreciosPorcentaje!=null) { this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jComboBoxid_empresaProcesoPreciosPorcentaje.setSelectedItem(empresaTemp); } } else { //jComboBoxid_empresaProcesoPreciosPorcentaje.setSelectedItem(empresaTemp); if(this.jInternalFrameDetalleFormProcesoPreciosPorcentaje!=null) { if(this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jComboBoxid_empresaProcesoPreciosPorcentaje.getItemCount()>0) { this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jComboBoxid_empresaProcesoPreciosPorcentaje.setSelectedIndex(0); } } } } if(conCombosBusquedas) { //BYDAN_BUSQUEDAS } } catch(Exception e) { throw e; } } public String getActualEmpresaForeignKeyDescripcion(Long idEmpresaSeleccionado)throws Exception { String sDescripcion=""; try { Empresa empresaTemp=null; for(Empresa empresaAux:empresasForeignKey) { if(empresaAux.getId()!=null && empresaAux.getId().equals(idEmpresaSeleccionado)) { empresaTemp=empresaAux; break; } } sDescripcion=EmpresaConstantesFunciones.getEmpresaDescripcion(empresaTemp); } catch(Exception e) { throw e; } return sDescripcion; } @SuppressWarnings("rawtypes") public void setActualEmpresaForeignKeyGenerico(Long idEmpresaSeleccionado,JComboBox jComboBoxid_empresaProcesoPreciosPorcentajeGenerico)throws Exception { try { Empresa empresaTemp=null; for(Empresa empresaAux:empresasForeignKey) { if(empresaAux.getId()!=null && empresaAux.getId().equals(idEmpresaSeleccionado)) { empresaTemp=empresaAux; break; } } if(empresaTemp!=null) { jComboBoxid_empresaProcesoPreciosPorcentajeGenerico.setSelectedItem(empresaTemp); } else { if(jComboBoxid_empresaProcesoPreciosPorcentajeGenerico!=null && jComboBoxid_empresaProcesoPreciosPorcentajeGenerico.getItemCount()>0) { jComboBoxid_empresaProcesoPreciosPorcentajeGenerico.setSelectedIndex(0); } } } catch(Exception e) { throw e; } } public void setActualSucursalForeignKey(Long idSucursalSeleccionado,Boolean conCombosBusquedas,String sFormularioTipoBusqueda)throws Exception { try { Sucursal sucursalTemp=null; for(Sucursal sucursalAux:sucursalsForeignKey) { if(sucursalAux.getId()!=null && sucursalAux.getId().equals(idSucursalSeleccionado)) { sucursalTemp=sucursalAux; break; } } if(sFormularioTipoBusqueda.equals("Formulario") || sFormularioTipoBusqueda.equals("Todos")){ if(sucursalTemp!=null) { if(this.procesopreciosporcentaje!=null) { this.procesopreciosporcentaje.setSucursal(sucursalTemp); } if(this.jInternalFrameDetalleFormProcesoPreciosPorcentaje!=null) { this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jComboBoxid_sucursalProcesoPreciosPorcentaje.setSelectedItem(sucursalTemp); } } else { //jComboBoxid_sucursalProcesoPreciosPorcentaje.setSelectedItem(sucursalTemp); if(this.jInternalFrameDetalleFormProcesoPreciosPorcentaje!=null) { if(this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jComboBoxid_sucursalProcesoPreciosPorcentaje.getItemCount()>0) { this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jComboBoxid_sucursalProcesoPreciosPorcentaje.setSelectedIndex(0); } } } } if(conCombosBusquedas) { //BYDAN_BUSQUEDAS } } catch(Exception e) { throw e; } } public String getActualSucursalForeignKeyDescripcion(Long idSucursalSeleccionado)throws Exception { String sDescripcion=""; try { Sucursal sucursalTemp=null; for(Sucursal sucursalAux:sucursalsForeignKey) { if(sucursalAux.getId()!=null && sucursalAux.getId().equals(idSucursalSeleccionado)) { sucursalTemp=sucursalAux; break; } } sDescripcion=SucursalConstantesFunciones.getSucursalDescripcion(sucursalTemp); } catch(Exception e) { throw e; } return sDescripcion; } @SuppressWarnings("rawtypes") public void setActualSucursalForeignKeyGenerico(Long idSucursalSeleccionado,JComboBox jComboBoxid_sucursalProcesoPreciosPorcentajeGenerico)throws Exception { try { Sucursal sucursalTemp=null; for(Sucursal sucursalAux:sucursalsForeignKey) { if(sucursalAux.getId()!=null && sucursalAux.getId().equals(idSucursalSeleccionado)) { sucursalTemp=sucursalAux; break; } } if(sucursalTemp!=null) { jComboBoxid_sucursalProcesoPreciosPorcentajeGenerico.setSelectedItem(sucursalTemp); } else { if(jComboBoxid_sucursalProcesoPreciosPorcentajeGenerico!=null && jComboBoxid_sucursalProcesoPreciosPorcentajeGenerico.getItemCount()>0) { jComboBoxid_sucursalProcesoPreciosPorcentajeGenerico.setSelectedIndex(0); } } } catch(Exception e) { throw e; } } public void setActualLineaForeignKey(Long idLineaSeleccionado,Boolean conCombosBusquedas,String sFormularioTipoBusqueda)throws Exception { try { Linea lineaTemp=null; for(Linea lineaAux:lineasForeignKey) { if(lineaAux.getId()!=null && lineaAux.getId().equals(idLineaSeleccionado)) { lineaTemp=lineaAux; break; } } if(sFormularioTipoBusqueda.equals("Formulario") || sFormularioTipoBusqueda.equals("Todos")){ if(lineaTemp!=null) { if(this.procesopreciosporcentaje!=null) { this.procesopreciosporcentaje.setLinea(lineaTemp); } if(this.jInternalFrameDetalleFormProcesoPreciosPorcentaje!=null) { this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jComboBoxid_lineaProcesoPreciosPorcentaje.setSelectedItem(lineaTemp); } } else { //jComboBoxid_lineaProcesoPreciosPorcentaje.setSelectedItem(lineaTemp); if(this.jInternalFrameDetalleFormProcesoPreciosPorcentaje!=null) { if(this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jComboBoxid_lineaProcesoPreciosPorcentaje.getItemCount()>0) { this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jComboBoxid_lineaProcesoPreciosPorcentaje.setSelectedIndex(0); } } } } if(conCombosBusquedas) { //BYDAN_BUSQUEDAS if(sFormularioTipoBusqueda.equals("BusquedaProcesoPreciosPorcentaje") || sFormularioTipoBusqueda.equals("Todos")){ if(lineaTemp!=null && jComboBoxid_lineaBusquedaProcesoPreciosPorcentajeProcesoPreciosPorcentaje!=null) { jComboBoxid_lineaBusquedaProcesoPreciosPorcentajeProcesoPreciosPorcentaje.setSelectedItem(lineaTemp); } else { if(jComboBoxid_lineaBusquedaProcesoPreciosPorcentajeProcesoPreciosPorcentaje!=null) { //jComboBoxid_lineaBusquedaProcesoPreciosPorcentajeProcesoPreciosPorcentaje.setSelectedItem(lineaTemp); if(jComboBoxid_lineaBusquedaProcesoPreciosPorcentajeProcesoPreciosPorcentaje.getItemCount()>0) { jComboBoxid_lineaBusquedaProcesoPreciosPorcentajeProcesoPreciosPorcentaje.setSelectedIndex(0); } } } } } } catch(Exception e) { throw e; } } public String getActualLineaForeignKeyDescripcion(Long idLineaSeleccionado)throws Exception { String sDescripcion=""; try { Linea lineaTemp=null; for(Linea lineaAux:lineasForeignKey) { if(lineaAux.getId()!=null && lineaAux.getId().equals(idLineaSeleccionado)) { lineaTemp=lineaAux; break; } } sDescripcion=LineaConstantesFunciones.getLineaDescripcion(lineaTemp); } catch(Exception e) { throw e; } return sDescripcion; } @SuppressWarnings("rawtypes") public void setActualLineaForeignKeyGenerico(Long idLineaSeleccionado,JComboBox jComboBoxid_lineaProcesoPreciosPorcentajeGenerico)throws Exception { try { Linea lineaTemp=null; for(Linea lineaAux:lineasForeignKey) { if(lineaAux.getId()!=null && lineaAux.getId().equals(idLineaSeleccionado)) { lineaTemp=lineaAux; break; } } if(lineaTemp!=null) { jComboBoxid_lineaProcesoPreciosPorcentajeGenerico.setSelectedItem(lineaTemp); } else { if(jComboBoxid_lineaProcesoPreciosPorcentajeGenerico!=null && jComboBoxid_lineaProcesoPreciosPorcentajeGenerico.getItemCount()>0) { jComboBoxid_lineaProcesoPreciosPorcentajeGenerico.setSelectedIndex(0); } } } catch(Exception e) { throw e; } } public void setActualLineaGrupoForeignKey(Long idLineaGrupoSeleccionado,Boolean conCombosBusquedas,String sFormularioTipoBusqueda)throws Exception { try { Linea lineagrupoTemp=null; for(Linea lineagrupoAux:lineagruposForeignKey) { if(lineagrupoAux.getId()!=null && lineagrupoAux.getId().equals(idLineaGrupoSeleccionado)) { lineagrupoTemp=lineagrupoAux; break; } } if(sFormularioTipoBusqueda.equals("Formulario") || sFormularioTipoBusqueda.equals("Todos")){ if(lineagrupoTemp!=null) { if(this.procesopreciosporcentaje!=null) { this.procesopreciosporcentaje.setLineaGrupo(lineagrupoTemp); } if(this.jInternalFrameDetalleFormProcesoPreciosPorcentaje!=null) { this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jComboBoxid_linea_grupoProcesoPreciosPorcentaje.setSelectedItem(lineagrupoTemp); } } else { //jComboBoxid_linea_grupoProcesoPreciosPorcentaje.setSelectedItem(lineagrupoTemp); if(this.jInternalFrameDetalleFormProcesoPreciosPorcentaje!=null) { if(this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jComboBoxid_linea_grupoProcesoPreciosPorcentaje.getItemCount()>0) { this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jComboBoxid_linea_grupoProcesoPreciosPorcentaje.setSelectedIndex(0); } } } } if(conCombosBusquedas) { //BYDAN_BUSQUEDAS if(sFormularioTipoBusqueda.equals("BusquedaProcesoPreciosPorcentaje") || sFormularioTipoBusqueda.equals("Todos")){ if(lineagrupoTemp!=null && jComboBoxid_linea_grupoBusquedaProcesoPreciosPorcentajeProcesoPreciosPorcentaje!=null) { jComboBoxid_linea_grupoBusquedaProcesoPreciosPorcentajeProcesoPreciosPorcentaje.setSelectedItem(lineagrupoTemp); } else { if(jComboBoxid_linea_grupoBusquedaProcesoPreciosPorcentajeProcesoPreciosPorcentaje!=null) { //jComboBoxid_linea_grupoBusquedaProcesoPreciosPorcentajeProcesoPreciosPorcentaje.setSelectedItem(lineagrupoTemp); if(jComboBoxid_linea_grupoBusquedaProcesoPreciosPorcentajeProcesoPreciosPorcentaje.getItemCount()>0) { jComboBoxid_linea_grupoBusquedaProcesoPreciosPorcentajeProcesoPreciosPorcentaje.setSelectedIndex(0); } } } } } } catch(Exception e) { throw e; } } public String getActualLineaGrupoForeignKeyDescripcion(Long idLineaGrupoSeleccionado)throws Exception { String sDescripcion=""; try { Linea lineagrupoTemp=null; for(Linea lineagrupoAux:lineagruposForeignKey) { if(lineagrupoAux.getId()!=null && lineagrupoAux.getId().equals(idLineaGrupoSeleccionado)) { lineagrupoTemp=lineagrupoAux; break; } } sDescripcion=LineaConstantesFunciones.getLineaDescripcion(lineagrupoTemp); } catch(Exception e) { throw e; } return sDescripcion; } @SuppressWarnings("rawtypes") public void setActualLineaGrupoForeignKeyGenerico(Long idLineaGrupoSeleccionado,JComboBox jComboBoxid_linea_grupoProcesoPreciosPorcentajeGenerico)throws Exception { try { Linea lineagrupoTemp=null; for(Linea lineagrupoAux:lineagruposForeignKey) { if(lineagrupoAux.getId()!=null && lineagrupoAux.getId().equals(idLineaGrupoSeleccionado)) { lineagrupoTemp=lineagrupoAux; break; } } if(lineagrupoTemp!=null) { jComboBoxid_linea_grupoProcesoPreciosPorcentajeGenerico.setSelectedItem(lineagrupoTemp); } else { if(jComboBoxid_linea_grupoProcesoPreciosPorcentajeGenerico!=null && jComboBoxid_linea_grupoProcesoPreciosPorcentajeGenerico.getItemCount()>0) { jComboBoxid_linea_grupoProcesoPreciosPorcentajeGenerico.setSelectedIndex(0); } } } catch(Exception e) { throw e; } } public void setActualLineaCategoriaForeignKey(Long idLineaCategoriaSeleccionado,Boolean conCombosBusquedas,String sFormularioTipoBusqueda)throws Exception { try { Linea lineacategoriaTemp=null; for(Linea lineacategoriaAux:lineacategoriasForeignKey) { if(lineacategoriaAux.getId()!=null && lineacategoriaAux.getId().equals(idLineaCategoriaSeleccionado)) { lineacategoriaTemp=lineacategoriaAux; break; } } if(sFormularioTipoBusqueda.equals("Formulario") || sFormularioTipoBusqueda.equals("Todos")){ if(lineacategoriaTemp!=null) { if(this.procesopreciosporcentaje!=null) { this.procesopreciosporcentaje.setLineaCategoria(lineacategoriaTemp); } if(this.jInternalFrameDetalleFormProcesoPreciosPorcentaje!=null) { this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jComboBoxid_linea_categoriaProcesoPreciosPorcentaje.setSelectedItem(lineacategoriaTemp); } } else { //jComboBoxid_linea_categoriaProcesoPreciosPorcentaje.setSelectedItem(lineacategoriaTemp); if(this.jInternalFrameDetalleFormProcesoPreciosPorcentaje!=null) { if(this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jComboBoxid_linea_categoriaProcesoPreciosPorcentaje.getItemCount()>0) { this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jComboBoxid_linea_categoriaProcesoPreciosPorcentaje.setSelectedIndex(0); } } } } if(conCombosBusquedas) { //BYDAN_BUSQUEDAS if(sFormularioTipoBusqueda.equals("BusquedaProcesoPreciosPorcentaje") || sFormularioTipoBusqueda.equals("Todos")){ if(lineacategoriaTemp!=null && jComboBoxid_linea_categoriaBusquedaProcesoPreciosPorcentajeProcesoPreciosPorcentaje!=null) { jComboBoxid_linea_categoriaBusquedaProcesoPreciosPorcentajeProcesoPreciosPorcentaje.setSelectedItem(lineacategoriaTemp); } else { if(jComboBoxid_linea_categoriaBusquedaProcesoPreciosPorcentajeProcesoPreciosPorcentaje!=null) { //jComboBoxid_linea_categoriaBusquedaProcesoPreciosPorcentajeProcesoPreciosPorcentaje.setSelectedItem(lineacategoriaTemp); if(jComboBoxid_linea_categoriaBusquedaProcesoPreciosPorcentajeProcesoPreciosPorcentaje.getItemCount()>0) { jComboBoxid_linea_categoriaBusquedaProcesoPreciosPorcentajeProcesoPreciosPorcentaje.setSelectedIndex(0); } } } } } } catch(Exception e) { throw e; } } public String getActualLineaCategoriaForeignKeyDescripcion(Long idLineaCategoriaSeleccionado)throws Exception { String sDescripcion=""; try { Linea lineacategoriaTemp=null; for(Linea lineacategoriaAux:lineacategoriasForeignKey) { if(lineacategoriaAux.getId()!=null && lineacategoriaAux.getId().equals(idLineaCategoriaSeleccionado)) { lineacategoriaTemp=lineacategoriaAux; break; } } sDescripcion=LineaConstantesFunciones.getLineaDescripcion(lineacategoriaTemp); } catch(Exception e) { throw e; } return sDescripcion; } @SuppressWarnings("rawtypes") public void setActualLineaCategoriaForeignKeyGenerico(Long idLineaCategoriaSeleccionado,JComboBox jComboBoxid_linea_categoriaProcesoPreciosPorcentajeGenerico)throws Exception { try { Linea lineacategoriaTemp=null; for(Linea lineacategoriaAux:lineacategoriasForeignKey) { if(lineacategoriaAux.getId()!=null && lineacategoriaAux.getId().equals(idLineaCategoriaSeleccionado)) { lineacategoriaTemp=lineacategoriaAux; break; } } if(lineacategoriaTemp!=null) { jComboBoxid_linea_categoriaProcesoPreciosPorcentajeGenerico.setSelectedItem(lineacategoriaTemp); } else { if(jComboBoxid_linea_categoriaProcesoPreciosPorcentajeGenerico!=null && jComboBoxid_linea_categoriaProcesoPreciosPorcentajeGenerico.getItemCount()>0) { jComboBoxid_linea_categoriaProcesoPreciosPorcentajeGenerico.setSelectedIndex(0); } } } catch(Exception e) { throw e; } } public void setActualLineaMarcaForeignKey(Long idLineaMarcaSeleccionado,Boolean conCombosBusquedas,String sFormularioTipoBusqueda)throws Exception { try { Linea lineamarcaTemp=null; for(Linea lineamarcaAux:lineamarcasForeignKey) { if(lineamarcaAux.getId()!=null && lineamarcaAux.getId().equals(idLineaMarcaSeleccionado)) { lineamarcaTemp=lineamarcaAux; break; } } if(sFormularioTipoBusqueda.equals("Formulario") || sFormularioTipoBusqueda.equals("Todos")){ if(lineamarcaTemp!=null) { if(this.procesopreciosporcentaje!=null) { this.procesopreciosporcentaje.setLineaMarca(lineamarcaTemp); } if(this.jInternalFrameDetalleFormProcesoPreciosPorcentaje!=null) { this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jComboBoxid_linea_marcaProcesoPreciosPorcentaje.setSelectedItem(lineamarcaTemp); } } else { //jComboBoxid_linea_marcaProcesoPreciosPorcentaje.setSelectedItem(lineamarcaTemp); if(this.jInternalFrameDetalleFormProcesoPreciosPorcentaje!=null) { if(this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jComboBoxid_linea_marcaProcesoPreciosPorcentaje.getItemCount()>0) { this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jComboBoxid_linea_marcaProcesoPreciosPorcentaje.setSelectedIndex(0); } } } } if(conCombosBusquedas) { //BYDAN_BUSQUEDAS if(sFormularioTipoBusqueda.equals("BusquedaProcesoPreciosPorcentaje") || sFormularioTipoBusqueda.equals("Todos")){ if(lineamarcaTemp!=null && jComboBoxid_linea_marcaBusquedaProcesoPreciosPorcentajeProcesoPreciosPorcentaje!=null) { jComboBoxid_linea_marcaBusquedaProcesoPreciosPorcentajeProcesoPreciosPorcentaje.setSelectedItem(lineamarcaTemp); } else { if(jComboBoxid_linea_marcaBusquedaProcesoPreciosPorcentajeProcesoPreciosPorcentaje!=null) { //jComboBoxid_linea_marcaBusquedaProcesoPreciosPorcentajeProcesoPreciosPorcentaje.setSelectedItem(lineamarcaTemp); if(jComboBoxid_linea_marcaBusquedaProcesoPreciosPorcentajeProcesoPreciosPorcentaje.getItemCount()>0) { jComboBoxid_linea_marcaBusquedaProcesoPreciosPorcentajeProcesoPreciosPorcentaje.setSelectedIndex(0); } } } } } } catch(Exception e) { throw e; } } public String getActualLineaMarcaForeignKeyDescripcion(Long idLineaMarcaSeleccionado)throws Exception { String sDescripcion=""; try { Linea lineamarcaTemp=null; for(Linea lineamarcaAux:lineamarcasForeignKey) { if(lineamarcaAux.getId()!=null && lineamarcaAux.getId().equals(idLineaMarcaSeleccionado)) { lineamarcaTemp=lineamarcaAux; break; } } sDescripcion=LineaConstantesFunciones.getLineaDescripcion(lineamarcaTemp); } catch(Exception e) { throw e; } return sDescripcion; } @SuppressWarnings("rawtypes") public void setActualLineaMarcaForeignKeyGenerico(Long idLineaMarcaSeleccionado,JComboBox jComboBoxid_linea_marcaProcesoPreciosPorcentajeGenerico)throws Exception { try { Linea lineamarcaTemp=null; for(Linea lineamarcaAux:lineamarcasForeignKey) { if(lineamarcaAux.getId()!=null && lineamarcaAux.getId().equals(idLineaMarcaSeleccionado)) { lineamarcaTemp=lineamarcaAux; break; } } if(lineamarcaTemp!=null) { jComboBoxid_linea_marcaProcesoPreciosPorcentajeGenerico.setSelectedItem(lineamarcaTemp); } else { if(jComboBoxid_linea_marcaProcesoPreciosPorcentajeGenerico!=null && jComboBoxid_linea_marcaProcesoPreciosPorcentajeGenerico.getItemCount()>0) { jComboBoxid_linea_marcaProcesoPreciosPorcentajeGenerico.setSelectedIndex(0); } } } catch(Exception e) { throw e; } } @SuppressWarnings("rawtypes") public void setActualParaGuardarBodegaForeignKey(ProcesoPreciosPorcentaje procesopreciosporcentaje,JComboBox jComboBoxid_bodegaProcesoPreciosPorcentajeGenerico)throws Exception { try { Bodega bodegaAux=new Bodega(); if(jComboBoxid_bodegaProcesoPreciosPorcentajeGenerico==null) { bodegaAux=(Bodega)this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jComboBoxid_bodegaProcesoPreciosPorcentaje.getSelectedItem(); } else { bodegaAux=(Bodega)jComboBoxid_bodegaProcesoPreciosPorcentajeGenerico.getSelectedItem(); } if(bodegaAux!=null && bodegaAux.getId()!=null) { procesopreciosporcentaje.setid_bodega(bodegaAux.getId()); procesopreciosporcentaje.setbodega_descripcion(ProcesoPreciosPorcentajeConstantesFunciones.getBodegaDescripcion(bodegaAux)); procesopreciosporcentaje.setBodega(bodegaAux); } } catch(Exception e) { throw e; } } @SuppressWarnings("rawtypes") public void setActualParaGuardarProductoForeignKey(ProcesoPreciosPorcentaje procesopreciosporcentaje,JComboBox jComboBoxid_productoProcesoPreciosPorcentajeGenerico)throws Exception { try { Producto productoAux=new Producto(); if(jComboBoxid_productoProcesoPreciosPorcentajeGenerico==null) { productoAux=(Producto)this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jComboBoxid_productoProcesoPreciosPorcentaje.getSelectedItem(); } else { productoAux=(Producto)jComboBoxid_productoProcesoPreciosPorcentajeGenerico.getSelectedItem(); } if(productoAux!=null && productoAux.getId()!=null) { procesopreciosporcentaje.setid_producto(productoAux.getId()); procesopreciosporcentaje.setproducto_descripcion(ProcesoPreciosPorcentajeConstantesFunciones.getProductoDescripcion(productoAux)); procesopreciosporcentaje.setProducto(productoAux); } } catch(Exception e) { throw e; } } @SuppressWarnings("rawtypes") public void setActualParaGuardarEmpresaForeignKey(ProcesoPreciosPorcentaje procesopreciosporcentaje,JComboBox jComboBoxid_empresaProcesoPreciosPorcentajeGenerico)throws Exception { try { Empresa empresaAux=new Empresa(); if(jComboBoxid_empresaProcesoPreciosPorcentajeGenerico==null) { empresaAux=(Empresa)this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jComboBoxid_empresaProcesoPreciosPorcentaje.getSelectedItem(); } else { empresaAux=(Empresa)jComboBoxid_empresaProcesoPreciosPorcentajeGenerico.getSelectedItem(); } if(empresaAux!=null && empresaAux.getId()!=null) { procesopreciosporcentaje.setid_empresa(empresaAux.getId()); procesopreciosporcentaje.setempresa_descripcion(ProcesoPreciosPorcentajeConstantesFunciones.getEmpresaDescripcion(empresaAux)); procesopreciosporcentaje.setEmpresa(empresaAux); } } catch(Exception e) { throw e; } } @SuppressWarnings("rawtypes") public void setActualParaGuardarSucursalForeignKey(ProcesoPreciosPorcentaje procesopreciosporcentaje,JComboBox jComboBoxid_sucursalProcesoPreciosPorcentajeGenerico)throws Exception { try { Sucursal sucursalAux=new Sucursal(); if(jComboBoxid_sucursalProcesoPreciosPorcentajeGenerico==null) { sucursalAux=(Sucursal)this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jComboBoxid_sucursalProcesoPreciosPorcentaje.getSelectedItem(); } else { sucursalAux=(Sucursal)jComboBoxid_sucursalProcesoPreciosPorcentajeGenerico.getSelectedItem(); } if(sucursalAux!=null && sucursalAux.getId()!=null) { procesopreciosporcentaje.setid_sucursal(sucursalAux.getId()); procesopreciosporcentaje.setsucursal_descripcion(ProcesoPreciosPorcentajeConstantesFunciones.getSucursalDescripcion(sucursalAux)); procesopreciosporcentaje.setSucursal(sucursalAux); } } catch(Exception e) { throw e; } } @SuppressWarnings("rawtypes") public void setActualParaGuardarLineaForeignKey(ProcesoPreciosPorcentaje procesopreciosporcentaje,JComboBox jComboBoxid_lineaProcesoPreciosPorcentajeGenerico)throws Exception { try { Linea lineaAux=new Linea(); if(jComboBoxid_lineaProcesoPreciosPorcentajeGenerico==null) { lineaAux=(Linea)this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jComboBoxid_lineaProcesoPreciosPorcentaje.getSelectedItem(); } else { lineaAux=(Linea)jComboBoxid_lineaProcesoPreciosPorcentajeGenerico.getSelectedItem(); } if(lineaAux!=null && lineaAux.getId()!=null) { procesopreciosporcentaje.setid_linea(lineaAux.getId()); procesopreciosporcentaje.setlinea_descripcion(ProcesoPreciosPorcentajeConstantesFunciones.getLineaDescripcion(lineaAux)); procesopreciosporcentaje.setLinea(lineaAux); } } catch(Exception e) { throw e; } } @SuppressWarnings("rawtypes") public void setActualParaGuardarLineaGrupoForeignKey(ProcesoPreciosPorcentaje procesopreciosporcentaje,JComboBox jComboBoxid_linea_grupoProcesoPreciosPorcentajeGenerico)throws Exception { try { Linea lineaAux=new Linea(); if(jComboBoxid_linea_grupoProcesoPreciosPorcentajeGenerico==null) { lineaAux=(Linea)this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jComboBoxid_linea_grupoProcesoPreciosPorcentaje.getSelectedItem(); } else { lineaAux=(Linea)jComboBoxid_linea_grupoProcesoPreciosPorcentajeGenerico.getSelectedItem(); } if(lineaAux!=null && lineaAux.getId()!=null) { procesopreciosporcentaje.setid_linea_grupo(lineaAux.getId()); procesopreciosporcentaje.setlineagrupo_descripcion(ProcesoPreciosPorcentajeConstantesFunciones.getLineaGrupoDescripcion(lineaAux)); procesopreciosporcentaje.setLineaGrupo(lineaAux); } } catch(Exception e) { throw e; } } @SuppressWarnings("rawtypes") public void setActualParaGuardarLineaCategoriaForeignKey(ProcesoPreciosPorcentaje procesopreciosporcentaje,JComboBox jComboBoxid_linea_categoriaProcesoPreciosPorcentajeGenerico)throws Exception { try { Linea lineaAux=new Linea(); if(jComboBoxid_linea_categoriaProcesoPreciosPorcentajeGenerico==null) { lineaAux=(Linea)this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jComboBoxid_linea_categoriaProcesoPreciosPorcentaje.getSelectedItem(); } else { lineaAux=(Linea)jComboBoxid_linea_categoriaProcesoPreciosPorcentajeGenerico.getSelectedItem(); } if(lineaAux!=null && lineaAux.getId()!=null) { procesopreciosporcentaje.setid_linea_categoria(lineaAux.getId()); procesopreciosporcentaje.setlineacategoria_descripcion(ProcesoPreciosPorcentajeConstantesFunciones.getLineaCategoriaDescripcion(lineaAux)); procesopreciosporcentaje.setLineaCategoria(lineaAux); } } catch(Exception e) { throw e; } } @SuppressWarnings("rawtypes") public void setActualParaGuardarLineaMarcaForeignKey(ProcesoPreciosPorcentaje procesopreciosporcentaje,JComboBox jComboBoxid_linea_marcaProcesoPreciosPorcentajeGenerico)throws Exception { try { Linea lineaAux=new Linea(); if(jComboBoxid_linea_marcaProcesoPreciosPorcentajeGenerico==null) { lineaAux=(Linea)this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jComboBoxid_linea_marcaProcesoPreciosPorcentaje.getSelectedItem(); } else { lineaAux=(Linea)jComboBoxid_linea_marcaProcesoPreciosPorcentajeGenerico.getSelectedItem(); } if(lineaAux!=null && lineaAux.getId()!=null) { procesopreciosporcentaje.setid_linea_marca(lineaAux.getId()); procesopreciosporcentaje.setlineamarca_descripcion(ProcesoPreciosPorcentajeConstantesFunciones.getLineaMarcaDescripcion(lineaAux)); procesopreciosporcentaje.setLineaMarca(lineaAux); } } catch(Exception e) { throw e; } } @SuppressWarnings({ "unchecked", "rawtypes" }) public void cargarCombosFrameBodegasForeignKey(String sFormularioTipoBusqueda)throws Exception { try { JComboBoxBinding jComboBoxBindingBodega=null; if(sFormularioTipoBusqueda.equals("Formulario") || sFormularioTipoBusqueda.equals("Todos")){ if(!ProcesoPreciosPorcentajeJInternalFrame.ISBINDING_MANUAL) { } else { if(this.jInternalFrameDetalleFormProcesoPreciosPorcentaje!=null) { this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jComboBoxid_bodegaProcesoPreciosPorcentaje.removeAllItems(); for(Bodega bodega:this.bodegasForeignKey) { this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jComboBoxid_bodegaProcesoPreciosPorcentaje.addItem(bodega); } } } if(this.jInternalFrameDetalleFormProcesoPreciosPorcentaje!=null) { } if(!ProcesoPreciosPorcentajeJInternalFrame.ISBINDING_MANUAL) { } } if(!this.conCargarMinimo) { if(sFormularioTipoBusqueda.equals("BusquedaProcesoPreciosPorcentaje") || sFormularioTipoBusqueda.equals("Todos")){ //BYDAN_BUSQUEDAS if(!ProcesoPreciosPorcentajeJInternalFrame.ISBINDING_MANUAL) { } else { this.jComboBoxid_bodegaBusquedaProcesoPreciosPorcentajeProcesoPreciosPorcentaje.removeAllItems(); for(Bodega bodega:this.bodegasForeignKey) { this.jComboBoxid_bodegaBusquedaProcesoPreciosPorcentajeProcesoPreciosPorcentaje.addItem(bodega); } } if(!ProcesoPreciosPorcentajeJInternalFrame.ISBINDING_MANUAL) { } } } } catch(Exception e) { throw e; } } @SuppressWarnings({ "unchecked", "rawtypes" }) public void cargarCombosFrameProductosForeignKey(String sFormularioTipoBusqueda)throws Exception { try { JComboBoxBinding jComboBoxBindingProducto=null; if(sFormularioTipoBusqueda.equals("Formulario") || sFormularioTipoBusqueda.equals("Todos")){ if(!ProcesoPreciosPorcentajeJInternalFrame.ISBINDING_MANUAL) { } else { if(this.jInternalFrameDetalleFormProcesoPreciosPorcentaje!=null) { this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jComboBoxid_productoProcesoPreciosPorcentaje.removeAllItems(); for(Producto producto:this.productosForeignKey) { this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jComboBoxid_productoProcesoPreciosPorcentaje.addItem(producto); } } } if(this.jInternalFrameDetalleFormProcesoPreciosPorcentaje!=null) { } if(!ProcesoPreciosPorcentajeJInternalFrame.ISBINDING_MANUAL) { } } if(!this.conCargarMinimo) { if(sFormularioTipoBusqueda.equals("BusquedaProcesoPreciosPorcentaje") || sFormularioTipoBusqueda.equals("Todos")){ //BYDAN_BUSQUEDAS if(!ProcesoPreciosPorcentajeJInternalFrame.ISBINDING_MANUAL) { } else { this.jComboBoxid_productoBusquedaProcesoPreciosPorcentajeProcesoPreciosPorcentaje.removeAllItems(); for(Producto producto:this.productosForeignKey) { this.jComboBoxid_productoBusquedaProcesoPreciosPorcentajeProcesoPreciosPorcentaje.addItem(producto); } } if(!ProcesoPreciosPorcentajeJInternalFrame.ISBINDING_MANUAL) { } } } } catch(Exception e) { throw e; } } @SuppressWarnings({ "unchecked", "rawtypes" }) public void cargarCombosFrameEmpresasForeignKey(String sFormularioTipoBusqueda)throws Exception { try { JComboBoxBinding jComboBoxBindingEmpresa=null; if(sFormularioTipoBusqueda.equals("Formulario") || sFormularioTipoBusqueda.equals("Todos")){ if(!ProcesoPreciosPorcentajeJInternalFrame.ISBINDING_MANUAL) { } else { if(this.jInternalFrameDetalleFormProcesoPreciosPorcentaje!=null) { this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jComboBoxid_empresaProcesoPreciosPorcentaje.removeAllItems(); for(Empresa empresa:this.empresasForeignKey) { this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jComboBoxid_empresaProcesoPreciosPorcentaje.addItem(empresa); } } } if(this.jInternalFrameDetalleFormProcesoPreciosPorcentaje!=null) { } if(!ProcesoPreciosPorcentajeJInternalFrame.ISBINDING_MANUAL) { } } if(!this.conCargarMinimo) { } } catch(Exception e) { throw e; } } @SuppressWarnings({ "unchecked", "rawtypes" }) public void cargarCombosFrameSucursalsForeignKey(String sFormularioTipoBusqueda)throws Exception { try { JComboBoxBinding jComboBoxBindingSucursal=null; if(sFormularioTipoBusqueda.equals("Formulario") || sFormularioTipoBusqueda.equals("Todos")){ if(!ProcesoPreciosPorcentajeJInternalFrame.ISBINDING_MANUAL) { } else { if(this.jInternalFrameDetalleFormProcesoPreciosPorcentaje!=null) { this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jComboBoxid_sucursalProcesoPreciosPorcentaje.removeAllItems(); for(Sucursal sucursal:this.sucursalsForeignKey) { this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jComboBoxid_sucursalProcesoPreciosPorcentaje.addItem(sucursal); } } } if(this.jInternalFrameDetalleFormProcesoPreciosPorcentaje!=null) { } if(!ProcesoPreciosPorcentajeJInternalFrame.ISBINDING_MANUAL) { } } if(!this.conCargarMinimo) { } } catch(Exception e) { throw e; } } @SuppressWarnings({ "unchecked", "rawtypes" }) public void cargarCombosFrameLineasForeignKey(String sFormularioTipoBusqueda)throws Exception { try { JComboBoxBinding jComboBoxBindingLinea=null; if(sFormularioTipoBusqueda.equals("Formulario") || sFormularioTipoBusqueda.equals("Todos")){ if(!ProcesoPreciosPorcentajeJInternalFrame.ISBINDING_MANUAL) { } else { if(this.jInternalFrameDetalleFormProcesoPreciosPorcentaje!=null) { this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jComboBoxid_lineaProcesoPreciosPorcentaje.removeAllItems(); for(Linea linea:this.lineasForeignKey) { this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jComboBoxid_lineaProcesoPreciosPorcentaje.addItem(linea); } } } if(this.jInternalFrameDetalleFormProcesoPreciosPorcentaje!=null) { } if(!ProcesoPreciosPorcentajeJInternalFrame.ISBINDING_MANUAL) { } } if(!this.conCargarMinimo) { if(sFormularioTipoBusqueda.equals("BusquedaProcesoPreciosPorcentaje") || sFormularioTipoBusqueda.equals("Todos")){ //BYDAN_BUSQUEDAS if(!ProcesoPreciosPorcentajeJInternalFrame.ISBINDING_MANUAL) { } else { this.jComboBoxid_lineaBusquedaProcesoPreciosPorcentajeProcesoPreciosPorcentaje.removeAllItems(); for(Linea linea:this.lineasForeignKey) { this.jComboBoxid_lineaBusquedaProcesoPreciosPorcentajeProcesoPreciosPorcentaje.addItem(linea); } } if(!ProcesoPreciosPorcentajeJInternalFrame.ISBINDING_MANUAL) { } } } } catch(Exception e) { throw e; } } @SuppressWarnings({ "unchecked", "rawtypes" }) public void cargarCombosFrameLineaGruposForeignKey(String sFormularioTipoBusqueda)throws Exception { try { JComboBoxBinding jComboBoxBindingLinea=null; if(sFormularioTipoBusqueda.equals("Formulario") || sFormularioTipoBusqueda.equals("Todos")){ if(!ProcesoPreciosPorcentajeJInternalFrame.ISBINDING_MANUAL) { } else { if(this.jInternalFrameDetalleFormProcesoPreciosPorcentaje!=null) { this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jComboBoxid_linea_grupoProcesoPreciosPorcentaje.removeAllItems(); for(Linea lineagrupo:this.lineagruposForeignKey) { this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jComboBoxid_linea_grupoProcesoPreciosPorcentaje.addItem(lineagrupo); } } } if(this.jInternalFrameDetalleFormProcesoPreciosPorcentaje!=null) { } if(!ProcesoPreciosPorcentajeJInternalFrame.ISBINDING_MANUAL) { } } if(!this.conCargarMinimo) { if(sFormularioTipoBusqueda.equals("BusquedaProcesoPreciosPorcentaje") || sFormularioTipoBusqueda.equals("Todos")){ //BYDAN_BUSQUEDAS if(!ProcesoPreciosPorcentajeJInternalFrame.ISBINDING_MANUAL) { } else { this.jComboBoxid_linea_grupoBusquedaProcesoPreciosPorcentajeProcesoPreciosPorcentaje.removeAllItems(); for(Linea lineagrupo:this.lineagruposForeignKey) { this.jComboBoxid_linea_grupoBusquedaProcesoPreciosPorcentajeProcesoPreciosPorcentaje.addItem(lineagrupo); } } if(!ProcesoPreciosPorcentajeJInternalFrame.ISBINDING_MANUAL) { } } } } catch(Exception e) { throw e; } } @SuppressWarnings({ "unchecked", "rawtypes" }) public void cargarCombosFrameLineaCategoriasForeignKey(String sFormularioTipoBusqueda)throws Exception { try { JComboBoxBinding jComboBoxBindingLinea=null; if(sFormularioTipoBusqueda.equals("Formulario") || sFormularioTipoBusqueda.equals("Todos")){ if(!ProcesoPreciosPorcentajeJInternalFrame.ISBINDING_MANUAL) { } else { if(this.jInternalFrameDetalleFormProcesoPreciosPorcentaje!=null) { this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jComboBoxid_linea_categoriaProcesoPreciosPorcentaje.removeAllItems(); for(Linea lineacategoria:this.lineacategoriasForeignKey) { this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jComboBoxid_linea_categoriaProcesoPreciosPorcentaje.addItem(lineacategoria); } } } if(this.jInternalFrameDetalleFormProcesoPreciosPorcentaje!=null) { } if(!ProcesoPreciosPorcentajeJInternalFrame.ISBINDING_MANUAL) { } } if(!this.conCargarMinimo) { if(sFormularioTipoBusqueda.equals("BusquedaProcesoPreciosPorcentaje") || sFormularioTipoBusqueda.equals("Todos")){ //BYDAN_BUSQUEDAS if(!ProcesoPreciosPorcentajeJInternalFrame.ISBINDING_MANUAL) { } else { this.jComboBoxid_linea_categoriaBusquedaProcesoPreciosPorcentajeProcesoPreciosPorcentaje.removeAllItems(); for(Linea lineacategoria:this.lineacategoriasForeignKey) { this.jComboBoxid_linea_categoriaBusquedaProcesoPreciosPorcentajeProcesoPreciosPorcentaje.addItem(lineacategoria); } } if(!ProcesoPreciosPorcentajeJInternalFrame.ISBINDING_MANUAL) { } } } } catch(Exception e) { throw e; } } @SuppressWarnings({ "unchecked", "rawtypes" }) public void cargarCombosFrameLineaMarcasForeignKey(String sFormularioTipoBusqueda)throws Exception { try { JComboBoxBinding jComboBoxBindingLinea=null; if(sFormularioTipoBusqueda.equals("Formulario") || sFormularioTipoBusqueda.equals("Todos")){ if(!ProcesoPreciosPorcentajeJInternalFrame.ISBINDING_MANUAL) { } else { if(this.jInternalFrameDetalleFormProcesoPreciosPorcentaje!=null) { this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jComboBoxid_linea_marcaProcesoPreciosPorcentaje.removeAllItems(); for(Linea lineamarca:this.lineamarcasForeignKey) { this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jComboBoxid_linea_marcaProcesoPreciosPorcentaje.addItem(lineamarca); } } } if(this.jInternalFrameDetalleFormProcesoPreciosPorcentaje!=null) { } if(!ProcesoPreciosPorcentajeJInternalFrame.ISBINDING_MANUAL) { } } if(!this.conCargarMinimo) { if(sFormularioTipoBusqueda.equals("BusquedaProcesoPreciosPorcentaje") || sFormularioTipoBusqueda.equals("Todos")){ //BYDAN_BUSQUEDAS if(!ProcesoPreciosPorcentajeJInternalFrame.ISBINDING_MANUAL) { } else { this.jComboBoxid_linea_marcaBusquedaProcesoPreciosPorcentajeProcesoPreciosPorcentaje.removeAllItems(); for(Linea lineamarca:this.lineamarcasForeignKey) { this.jComboBoxid_linea_marcaBusquedaProcesoPreciosPorcentajeProcesoPreciosPorcentaje.addItem(lineamarca); } } if(!ProcesoPreciosPorcentajeJInternalFrame.ISBINDING_MANUAL) { } } } } catch(Exception e) { throw e; } } public void setSelectedItemCombosFrameBodegaForeignKey(Bodega bodega,int iIndexSelected,Boolean conSelectedIndex,Boolean conFormulario,Boolean conBusqueda)throws Exception { try { if(conFormulario) { if(!conSelectedIndex) { if(this.jInternalFrameDetalleFormProcesoPreciosPorcentaje!=null) { this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jComboBoxid_bodegaProcesoPreciosPorcentaje.setSelectedItem(bodega); } } else { if(this.jInternalFrameDetalleFormProcesoPreciosPorcentaje!=null) { this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jComboBoxid_bodegaProcesoPreciosPorcentaje.setSelectedIndex(iIndexSelected); } } } if(!this.conCargarMinimo) { if(conBusqueda) { //BYDAN_BUSQUEDAS if(!conSelectedIndex) { this.jComboBoxid_bodegaBusquedaProcesoPreciosPorcentajeProcesoPreciosPorcentaje.setSelectedItem(bodega); } else { this.jComboBoxid_bodegaBusquedaProcesoPreciosPorcentajeProcesoPreciosPorcentaje.setSelectedIndex(iIndexSelected); } } } } catch(Exception e) { throw e; } } public void setSelectedItemCombosFrameProductoForeignKey(Producto producto,int iIndexSelected,Boolean conSelectedIndex,Boolean conFormulario,Boolean conBusqueda)throws Exception { try { if(conFormulario) { if(!conSelectedIndex) { if(this.jInternalFrameDetalleFormProcesoPreciosPorcentaje!=null) { this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jComboBoxid_productoProcesoPreciosPorcentaje.setSelectedItem(producto); } } else { if(this.jInternalFrameDetalleFormProcesoPreciosPorcentaje!=null) { this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jComboBoxid_productoProcesoPreciosPorcentaje.setSelectedIndex(iIndexSelected); } } } if(!this.conCargarMinimo) { if(conBusqueda) { //BYDAN_BUSQUEDAS if(!conSelectedIndex) { this.jComboBoxid_productoBusquedaProcesoPreciosPorcentajeProcesoPreciosPorcentaje.setSelectedItem(producto); } else { this.jComboBoxid_productoBusquedaProcesoPreciosPorcentajeProcesoPreciosPorcentaje.setSelectedIndex(iIndexSelected); } } } } catch(Exception e) { throw e; } } public void setSelectedItemCombosFrameEmpresaForeignKey(Empresa empresa,int iIndexSelected,Boolean conSelectedIndex,Boolean conFormulario,Boolean conBusqueda)throws Exception { try { if(conFormulario) { if(!conSelectedIndex) { if(this.jInternalFrameDetalleFormProcesoPreciosPorcentaje!=null) { this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jComboBoxid_empresaProcesoPreciosPorcentaje.setSelectedItem(empresa); } } else { if(this.jInternalFrameDetalleFormProcesoPreciosPorcentaje!=null) { this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jComboBoxid_empresaProcesoPreciosPorcentaje.setSelectedIndex(iIndexSelected); } } } if(!this.conCargarMinimo) { if(conBusqueda) { //BYDAN_BUSQUEDAS } } } catch(Exception e) { throw e; } } public void setSelectedItemCombosFrameSucursalForeignKey(Sucursal sucursal,int iIndexSelected,Boolean conSelectedIndex,Boolean conFormulario,Boolean conBusqueda)throws Exception { try { if(conFormulario) { if(!conSelectedIndex) { if(this.jInternalFrameDetalleFormProcesoPreciosPorcentaje!=null) { this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jComboBoxid_sucursalProcesoPreciosPorcentaje.setSelectedItem(sucursal); } } else { if(this.jInternalFrameDetalleFormProcesoPreciosPorcentaje!=null) { this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jComboBoxid_sucursalProcesoPreciosPorcentaje.setSelectedIndex(iIndexSelected); } } } if(!this.conCargarMinimo) { if(conBusqueda) { //BYDAN_BUSQUEDAS } } } catch(Exception e) { throw e; } } public void setSelectedItemCombosFrameLineaForeignKey(Linea linea,int iIndexSelected,Boolean conSelectedIndex,Boolean conFormulario,Boolean conBusqueda)throws Exception { try { if(conFormulario) { if(!conSelectedIndex) { if(this.jInternalFrameDetalleFormProcesoPreciosPorcentaje!=null) { this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jComboBoxid_lineaProcesoPreciosPorcentaje.setSelectedItem(linea); } } else { if(this.jInternalFrameDetalleFormProcesoPreciosPorcentaje!=null) { this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jComboBoxid_lineaProcesoPreciosPorcentaje.setSelectedIndex(iIndexSelected); } } } if(!this.conCargarMinimo) { if(conBusqueda) { //BYDAN_BUSQUEDAS if(!conSelectedIndex) { this.jComboBoxid_lineaBusquedaProcesoPreciosPorcentajeProcesoPreciosPorcentaje.setSelectedItem(linea); } else { this.jComboBoxid_lineaBusquedaProcesoPreciosPorcentajeProcesoPreciosPorcentaje.setSelectedIndex(iIndexSelected); } } } } catch(Exception e) { throw e; } } public void setSelectedItemCombosFrameLineaGrupoForeignKey(Linea lineagrupo,int iIndexSelected,Boolean conSelectedIndex,Boolean conFormulario,Boolean conBusqueda)throws Exception { try { if(conFormulario) { if(!conSelectedIndex) { if(this.jInternalFrameDetalleFormProcesoPreciosPorcentaje!=null) { this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jComboBoxid_linea_grupoProcesoPreciosPorcentaje.setSelectedItem(lineagrupo); } } else { if(this.jInternalFrameDetalleFormProcesoPreciosPorcentaje!=null) { this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jComboBoxid_linea_grupoProcesoPreciosPorcentaje.setSelectedIndex(iIndexSelected); } } } if(!this.conCargarMinimo) { if(conBusqueda) { //BYDAN_BUSQUEDAS if(!conSelectedIndex) { this.jComboBoxid_linea_grupoBusquedaProcesoPreciosPorcentajeProcesoPreciosPorcentaje.setSelectedItem(lineagrupo); } else { this.jComboBoxid_linea_grupoBusquedaProcesoPreciosPorcentajeProcesoPreciosPorcentaje.setSelectedIndex(iIndexSelected); } } } } catch(Exception e) { throw e; } } public void setSelectedItemCombosFrameLineaCategoriaForeignKey(Linea lineacategoria,int iIndexSelected,Boolean conSelectedIndex,Boolean conFormulario,Boolean conBusqueda)throws Exception { try { if(conFormulario) { if(!conSelectedIndex) { if(this.jInternalFrameDetalleFormProcesoPreciosPorcentaje!=null) { this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jComboBoxid_linea_categoriaProcesoPreciosPorcentaje.setSelectedItem(lineacategoria); } } else { if(this.jInternalFrameDetalleFormProcesoPreciosPorcentaje!=null) { this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jComboBoxid_linea_categoriaProcesoPreciosPorcentaje.setSelectedIndex(iIndexSelected); } } } if(!this.conCargarMinimo) { if(conBusqueda) { //BYDAN_BUSQUEDAS if(!conSelectedIndex) { this.jComboBoxid_linea_categoriaBusquedaProcesoPreciosPorcentajeProcesoPreciosPorcentaje.setSelectedItem(lineacategoria); } else { this.jComboBoxid_linea_categoriaBusquedaProcesoPreciosPorcentajeProcesoPreciosPorcentaje.setSelectedIndex(iIndexSelected); } } } } catch(Exception e) { throw e; } } public void setSelectedItemCombosFrameLineaMarcaForeignKey(Linea lineamarca,int iIndexSelected,Boolean conSelectedIndex,Boolean conFormulario,Boolean conBusqueda)throws Exception { try { if(conFormulario) { if(!conSelectedIndex) { if(this.jInternalFrameDetalleFormProcesoPreciosPorcentaje!=null) { this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jComboBoxid_linea_marcaProcesoPreciosPorcentaje.setSelectedItem(lineamarca); } } else { if(this.jInternalFrameDetalleFormProcesoPreciosPorcentaje!=null) { this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jComboBoxid_linea_marcaProcesoPreciosPorcentaje.setSelectedIndex(iIndexSelected); } } } if(!this.conCargarMinimo) { if(conBusqueda) { //BYDAN_BUSQUEDAS if(!conSelectedIndex) { this.jComboBoxid_linea_marcaBusquedaProcesoPreciosPorcentajeProcesoPreciosPorcentaje.setSelectedItem(lineamarca); } else { this.jComboBoxid_linea_marcaBusquedaProcesoPreciosPorcentajeProcesoPreciosPorcentaje.setSelectedIndex(iIndexSelected); } } } } catch(Exception e) { throw e; } } public void refrescarForeignKeysDescripcionesProcesoPreciosPorcentaje() throws Exception { } public Integer getiNumeroPaginacion() { return iNumeroPaginacion; } public void setiNumeroPaginacion(Integer iNumeroPaginacion) { this.iNumeroPaginacion= iNumeroPaginacion; } public Integer getiNumeroPaginacionPagina() { return iNumeroPaginacionPagina; } public void setiNumeroPaginacionPagina(Integer iNumeroPaginacionPagina) { this.iNumeroPaginacionPagina= iNumeroPaginacionPagina; } public Boolean getIsSeleccionarTodos() { return this.isSeleccionarTodos; } public void setIsSeleccionarTodos(Boolean isSeleccionarTodos) { this.isSeleccionarTodos= isSeleccionarTodos; } public Boolean getEsControlTabla() { return this.esControlTabla; } public void setEsControlTabla(Boolean esControlTabla) { this.esControlTabla= esControlTabla; } public Boolean getIsSeleccionados() { return this.isSeleccionados; } public void setIsSeleccionados(Boolean isSeleccionados) { this.isSeleccionados= isSeleccionados; } public Boolean getIsPostAccionNuevo() { return this.isPostAccionNuevo; } public void setIsPostAccionNuevo(Boolean isPostAccionNuevo) { this.isPostAccionNuevo= isPostAccionNuevo; } public Boolean getIsPostAccionSinCerrar() { return this.isPostAccionSinCerrar; } public void setIsPostAccionSinCerrar(Boolean isPostAccionSinCerrar) { this.isPostAccionSinCerrar= isPostAccionSinCerrar; } public Boolean getIsPostAccionSinMensaje() { return this.isPostAccionSinMensaje; } public void setIsPostAccionSinMensaje(Boolean isPostAccionSinMensaje) { this.isPostAccionSinMensaje= isPostAccionSinMensaje; } public Boolean getConGraficoReporte() { return this.conGraficoReporte; } public void setConGraficoReporte(Boolean conGraficoReporte) { this.conGraficoReporte= conGraficoReporte; } public ArrayList<Reporte> gettiposArchivosReportes() { return this.tiposArchivosReportes; } public void settiposArchivosReportes(ArrayList<Reporte> tiposArchivosReportes) { this.tiposArchivosReportes = tiposArchivosReportes; } //TIPOS ARCHIVOS DINAMICOS public ArrayList<Reporte> gettiposArchivosReportesDinamico() { return this.tiposArchivosReportesDinamico; } public void settiposArchivosReportesDinamico(ArrayList<Reporte> tiposArchivosReportesDinamico) { this.tiposArchivosReportesDinamico = tiposArchivosReportesDinamico; } //TIPOS REPORTES public ArrayList<Reporte> gettiposReportes() { return this.tiposReportes; } public void settiposReportes(ArrayList<Reporte> tiposReportes) { this.tiposReportes = tiposReportes; } //TIPOS REPORTES public ArrayList<Reporte> gettiposReportesDinamico() { return this.tiposReportesDinamico; } public void settiposReportesDinamico(ArrayList<Reporte> tiposReportesDinamico) { this.tiposReportesDinamico = tiposReportesDinamico; } //TIPOS GRAFICOS REPORTES public ArrayList<Reporte> gettiposGraficosReportes() { return this.tiposGraficosReportes; } public void settiposGraficosReportes(ArrayList<Reporte> tiposGraficosReportes) { this.tiposGraficosReportes = tiposGraficosReportes; } public ArrayList<Reporte> gettiposPaginacion() { return this.tiposPaginacion; } public void settiposPaginacion(ArrayList<Reporte> tiposPaginacion) { this.tiposPaginacion = tiposPaginacion; } public ArrayList<Reporte> gettiposRelaciones() { return this.tiposRelaciones; } public void settiposRelaciones(ArrayList<Reporte> tiposRelaciones) { this.tiposRelaciones= tiposRelaciones; } public ArrayList<Reporte> gettiposAcciones() { return this.tiposAcciones; } public void settiposAcciones(ArrayList<Reporte> tiposAcciones) { this.tiposAcciones = tiposAcciones; } public ArrayList<Reporte> gettiposAccionesFormulario() { return this.tiposAccionesFormulario; } public void settiposAccionesFormulario(ArrayList<Reporte> tiposAccionesFormulario) { this.tiposAccionesFormulario = tiposAccionesFormulario; } public ArrayList<Reporte> gettiposSeleccionar() { return this.tiposSeleccionar; } public void settiposSeleccionar(ArrayList<Reporte> tiposSeleccionar) { this.tiposSeleccionar = tiposSeleccionar; } public ArrayList<Reporte> gettiposColumnasSelect() { return this.tiposColumnasSelect; } public void settiposColumnasSelect(ArrayList<Reporte> tiposColumnasSelect) { this.tiposColumnasSelect = tiposColumnasSelect; } public ArrayList<Reporte> gettiposRelacionesSelect() { return this.tiposRelacionesSelect; } public void settiposRelacionesSelect(ArrayList<Reporte> tiposRelacionesSelect) { this.tiposRelacionesSelect = tiposRelacionesSelect; } public Long getIIdUsuarioSesion() { return lIdUsuarioSesion; } public void setIIdUsuarioSesion(Long lIdUsuarioSesion) { this.lIdUsuarioSesion = lIdUsuarioSesion; } public List<Accion> getAccions() { return this.accions; } public void setAccions(List<Accion> accions) { this.accions = accions; } public List<Accion> getAccionsFormulario() { return this.accionsFormulario; } public void setAccionsFormulario(List<Accion> accionsFormulario) { this.accionsFormulario = accionsFormulario; } public String getsAccionMantenimiento() { return sAccionMantenimiento; } public void setsAccionMantenimiento(String sAccionMantenimiento) { this.sAccionMantenimiento = sAccionMantenimiento; } public String getsAccionBusqueda() { return sAccionBusqueda; } public void setsAccionBusqueda(String sAccionBusqueda) { this.sAccionBusqueda = sAccionBusqueda; } public String getsAccionAdicional() { return sAccionAdicional; } public void setsAccionAdicional(String sAccionAdicional) { this.sAccionAdicional = sAccionAdicional; } public String getsUltimaBusqueda() { return sUltimaBusqueda; } public void setsUltimaBusqueda(String sUltimaBusqueda) { this.sUltimaBusqueda = sUltimaBusqueda; } public String getsTipoArchivoReporte() { return sTipoArchivoReporte; } public void setsTipoArchivoReporte(String sTipoArchivoReporte) { this.sTipoArchivoReporte = sTipoArchivoReporte; } public String getsTipoArchivoReporteDinamico() { return sTipoArchivoReporteDinamico; } public void setsTipoArchivoReporteDinamico(String sTipoArchivoReporteDinamico) { this.sTipoArchivoReporteDinamico = sTipoArchivoReporteDinamico; } public String getsTipoReporte() { return sTipoReporte; } public void setsTipoReporte(String sTipoReporte) { this.sTipoReporte = sTipoReporte; } public String getsTipoReporteDinamico() { return sTipoReporteDinamico; } public void setsTipoReporteDinamico(String sTipoReporteDinamico) { this.sTipoReporteDinamico = sTipoReporteDinamico; } public String getsTipoGraficoReporte() { return sTipoGraficoReporte; } public void setsTipoGraficoReporte(String sTipoGraficoReporte) { this.sTipoGraficoReporte = sTipoGraficoReporte; } public String getsTipoPaginacion() { return sTipoPaginacion; } public void setsTipoPaginacion(String sTipoPaginacion) { this.sTipoPaginacion = sTipoPaginacion; } public String getsTipoRelacion() { return sTipoRelacion; } public void setsTipoRelacion(String sTipoRelacion) { this.sTipoRelacion = sTipoRelacion; } public String getsTipoAccion() { return sTipoAccion; } public void setsTipoAccion(String sTipoAccion) { this.sTipoAccion = sTipoAccion; } public String getsTipoAccionFormulario() { return sTipoAccionFormulario; } public void setsTipoAccionFormulario(String sTipoAccionFormulario) { this.sTipoAccionFormulario = sTipoAccionFormulario; } public String getsTipoSeleccionar() { return sTipoSeleccionar; } public void setsTipoSeleccionar(String sTipoSeleccionar) { this.sTipoSeleccionar = sTipoSeleccionar; } public String getsValorCampoGeneral() { return sValorCampoGeneral; } public void setsValorCampoGeneral(String sValorCampoGeneral) { this.sValorCampoGeneral = sValorCampoGeneral; } public String getsDetalleReporte() { return sDetalleReporte; } public void setsDetalleReporte(String sDetalleReporte) { this.sDetalleReporte = sDetalleReporte; } public String getsTipoReporteExtra() { return sTipoReporteExtra; } public void setsTipoReporteExtra(String sTipoReporteExtra) { this.sTipoReporteExtra = sTipoReporteExtra; } public Boolean getesReporteDinamico() { return esReporteDinamico; } public void setesReporteDinamico(Boolean esReporteDinamico) { this.esReporteDinamico = esReporteDinamico; } public Boolean getesRecargarFks() { return esRecargarFks; } public void setesRecargarFks(Boolean esRecargarFks) { this.esRecargarFks = esRecargarFks; } public Boolean getesReporteAccionProceso() { return esReporteAccionProceso; } public void setesReporteAccionProceso(Boolean esReporteAccionProceso) { this.esReporteAccionProceso= esReporteAccionProceso; } public ProcesoPreciosPorcentajeParameterReturnGeneral getProcesoPreciosPorcentajeParameterGeneral() { return this.procesopreciosporcentajeParameterGeneral; } public void setProcesoPreciosPorcentajeParameterGeneral(ProcesoPreciosPorcentajeParameterReturnGeneral procesopreciosporcentajeParameterGeneral) { this.procesopreciosporcentajeParameterGeneral = procesopreciosporcentajeParameterGeneral; } public String getsPathReporteDinamico() { return sPathReporteDinamico; } public void setsPathReporteDinamico(String sPathReporteDinamico) { this.sPathReporteDinamico = sPathReporteDinamico; } public Boolean getisMostrarNumeroPaginacion() { return isMostrarNumeroPaginacion; } public void setisMostrarNumeroPaginacion(Boolean isMostrarNumeroPaginacion) { this.isMostrarNumeroPaginacion = isMostrarNumeroPaginacion; } public Mensaje getMensaje() { return mensaje; } public void setMensaje(Mensaje mensaje) { this.mensaje = mensaje; } public Boolean getIsPermisoTodoProcesoPreciosPorcentaje() { return isPermisoTodoProcesoPreciosPorcentaje; } public void setIsPermisoTodoProcesoPreciosPorcentaje(Boolean isPermisoTodoProcesoPreciosPorcentaje) { this.isPermisoTodoProcesoPreciosPorcentaje = isPermisoTodoProcesoPreciosPorcentaje; } public Boolean getIsPermisoNuevoProcesoPreciosPorcentaje() { return isPermisoNuevoProcesoPreciosPorcentaje; } public void setIsPermisoNuevoProcesoPreciosPorcentaje(Boolean isPermisoNuevoProcesoPreciosPorcentaje) { this.isPermisoNuevoProcesoPreciosPorcentaje = isPermisoNuevoProcesoPreciosPorcentaje; } public Boolean getIsPermisoActualizarProcesoPreciosPorcentaje() { return isPermisoActualizarProcesoPreciosPorcentaje; } public void setIsPermisoActualizarProcesoPreciosPorcentaje(Boolean isPermisoActualizarProcesoPreciosPorcentaje) { this.isPermisoActualizarProcesoPreciosPorcentaje = isPermisoActualizarProcesoPreciosPorcentaje; } public Boolean getIsPermisoEliminarProcesoPreciosPorcentaje() { return isPermisoEliminarProcesoPreciosPorcentaje; } public void setIsPermisoEliminarProcesoPreciosPorcentaje(Boolean isPermisoEliminarProcesoPreciosPorcentaje) { this.isPermisoEliminarProcesoPreciosPorcentaje = isPermisoEliminarProcesoPreciosPorcentaje; } public Boolean getIsPermisoGuardarCambiosProcesoPreciosPorcentaje() { return isPermisoGuardarCambiosProcesoPreciosPorcentaje; } public void setIsPermisoGuardarCambiosProcesoPreciosPorcentaje(Boolean isPermisoGuardarCambiosProcesoPreciosPorcentaje) { this.isPermisoGuardarCambiosProcesoPreciosPorcentaje = isPermisoGuardarCambiosProcesoPreciosPorcentaje; } public Boolean getIsPermisoConsultaProcesoPreciosPorcentaje() { return isPermisoConsultaProcesoPreciosPorcentaje; } public void setIsPermisoConsultaProcesoPreciosPorcentaje(Boolean isPermisoConsultaProcesoPreciosPorcentaje) { this.isPermisoConsultaProcesoPreciosPorcentaje = isPermisoConsultaProcesoPreciosPorcentaje; } public Boolean getIsPermisoBusquedaProcesoPreciosPorcentaje() { return isPermisoBusquedaProcesoPreciosPorcentaje; } public void setIsPermisoBusquedaProcesoPreciosPorcentaje(Boolean isPermisoBusquedaProcesoPreciosPorcentaje) { this.isPermisoBusquedaProcesoPreciosPorcentaje = isPermisoBusquedaProcesoPreciosPorcentaje; } public Boolean getIsPermisoReporteProcesoPreciosPorcentaje() { return isPermisoReporteProcesoPreciosPorcentaje; } public void setIsPermisoReporteProcesoPreciosPorcentaje(Boolean isPermisoReporteProcesoPreciosPorcentaje) { this.isPermisoReporteProcesoPreciosPorcentaje = isPermisoReporteProcesoPreciosPorcentaje; } public Boolean getIsPermisoPaginacionMedioProcesoPreciosPorcentaje() { return isPermisoPaginacionMedioProcesoPreciosPorcentaje; } public void setIsPermisoPaginacionMedioProcesoPreciosPorcentaje(Boolean isPermisoPaginacionMedioProcesoPreciosPorcentaje) { this.isPermisoPaginacionMedioProcesoPreciosPorcentaje = isPermisoPaginacionMedioProcesoPreciosPorcentaje; } public Boolean getIsPermisoPaginacionTodoProcesoPreciosPorcentaje() { return isPermisoPaginacionTodoProcesoPreciosPorcentaje; } public void setIsPermisoPaginacionTodoProcesoPreciosPorcentaje(Boolean isPermisoPaginacionTodoProcesoPreciosPorcentaje) { this.isPermisoPaginacionTodoProcesoPreciosPorcentaje = isPermisoPaginacionTodoProcesoPreciosPorcentaje; } public Boolean getIsPermisoPaginacionAltoProcesoPreciosPorcentaje() { return isPermisoPaginacionAltoProcesoPreciosPorcentaje; } public void setIsPermisoPaginacionAltoProcesoPreciosPorcentaje(Boolean isPermisoPaginacionAltoProcesoPreciosPorcentaje) { this.isPermisoPaginacionAltoProcesoPreciosPorcentaje = isPermisoPaginacionAltoProcesoPreciosPorcentaje; } public Boolean getIsPermisoCopiarProcesoPreciosPorcentaje() { return isPermisoCopiarProcesoPreciosPorcentaje; } public void setIsPermisoCopiarProcesoPreciosPorcentaje(Boolean isPermisoCopiarProcesoPreciosPorcentaje) { this.isPermisoCopiarProcesoPreciosPorcentaje = isPermisoCopiarProcesoPreciosPorcentaje; } public Boolean getIsPermisoVerFormProcesoPreciosPorcentaje() { return isPermisoVerFormProcesoPreciosPorcentaje; } public void setIsPermisoVerFormProcesoPreciosPorcentaje(Boolean isPermisoVerFormProcesoPreciosPorcentaje) { this.isPermisoVerFormProcesoPreciosPorcentaje = isPermisoVerFormProcesoPreciosPorcentaje; } public Boolean getIsPermisoDuplicarProcesoPreciosPorcentaje() { return isPermisoDuplicarProcesoPreciosPorcentaje; } public void setIsPermisoDuplicarProcesoPreciosPorcentaje(Boolean isPermisoDuplicarProcesoPreciosPorcentaje) { this.isPermisoDuplicarProcesoPreciosPorcentaje = isPermisoDuplicarProcesoPreciosPorcentaje; } public Boolean getIsPermisoOrdenProcesoPreciosPorcentaje() { return isPermisoOrdenProcesoPreciosPorcentaje; } public void setIsPermisoOrdenProcesoPreciosPorcentaje(Boolean isPermisoOrdenProcesoPreciosPorcentaje) { this.isPermisoOrdenProcesoPreciosPorcentaje = isPermisoOrdenProcesoPreciosPorcentaje; } public String getsVisibilidadTablaBusquedas() { return sVisibilidadTablaBusquedas; } public void setsVisibilidadTablaBusquedas(String sVisibilidadTablaBusquedas) { this.sVisibilidadTablaBusquedas = sVisibilidadTablaBusquedas; } public String getsVisibilidadTablaElementos() { return sVisibilidadTablaElementos; } public void setsVisibilidadTablaElementos(String sVisibilidadTablaElementos) { this.sVisibilidadTablaElementos = sVisibilidadTablaElementos; } public String getsVisibilidadTablaAcciones() { return sVisibilidadTablaAcciones; } public void setsVisibilidadTablaAcciones(String sVisibilidadTablaAcciones) { this.sVisibilidadTablaAcciones = sVisibilidadTablaAcciones; } public Boolean getIsVisibilidadCeldaNuevoProcesoPreciosPorcentaje() { return isVisibilidadCeldaNuevoProcesoPreciosPorcentaje; } public void setIsVisibilidadCeldaNuevoProcesoPreciosPorcentaje(Boolean isVisibilidadCeldaNuevoProcesoPreciosPorcentaje) { this.isVisibilidadCeldaNuevoProcesoPreciosPorcentaje = isVisibilidadCeldaNuevoProcesoPreciosPorcentaje; } public Boolean getIsVisibilidadCeldaDuplicarProcesoPreciosPorcentaje() { return isVisibilidadCeldaDuplicarProcesoPreciosPorcentaje; } public void setIsVisibilidadCeldaDuplicarProcesoPreciosPorcentaje(Boolean isVisibilidadCeldaDuplicarProcesoPreciosPorcentaje) { this.isVisibilidadCeldaDuplicarProcesoPreciosPorcentaje = isVisibilidadCeldaDuplicarProcesoPreciosPorcentaje; } public Boolean getIsVisibilidadCeldaCopiarProcesoPreciosPorcentaje() { return isVisibilidadCeldaCopiarProcesoPreciosPorcentaje; } public void setIsVisibilidadCeldaCopiarProcesoPreciosPorcentaje(Boolean isVisibilidadCeldaCopiarProcesoPreciosPorcentaje) { this.isVisibilidadCeldaCopiarProcesoPreciosPorcentaje = isVisibilidadCeldaCopiarProcesoPreciosPorcentaje; } public Boolean getIsVisibilidadCeldaVerFormProcesoPreciosPorcentaje() { return isVisibilidadCeldaVerFormProcesoPreciosPorcentaje; } public void setIsVisibilidadCeldaVerFormProcesoPreciosPorcentaje(Boolean isVisibilidadCeldaVerFormProcesoPreciosPorcentaje) { this.isVisibilidadCeldaVerFormProcesoPreciosPorcentaje = isVisibilidadCeldaVerFormProcesoPreciosPorcentaje; } public Boolean getIsVisibilidadCeldaOrdenProcesoPreciosPorcentaje() { return isVisibilidadCeldaOrdenProcesoPreciosPorcentaje; } public void setIsVisibilidadCeldaOrdenProcesoPreciosPorcentaje(Boolean isVisibilidadCeldaOrdenProcesoPreciosPorcentaje) { this.isVisibilidadCeldaOrdenProcesoPreciosPorcentaje = isVisibilidadCeldaOrdenProcesoPreciosPorcentaje; } public Boolean getIsVisibilidadCeldaNuevoRelacionesProcesoPreciosPorcentaje() { return isVisibilidadCeldaNuevoRelacionesProcesoPreciosPorcentaje; } public void setIsVisibilidadCeldaNuevoRelacionesProcesoPreciosPorcentaje(Boolean isVisibilidadCeldaNuevoRelacionesProcesoPreciosPorcentaje) { this.isVisibilidadCeldaNuevoRelacionesProcesoPreciosPorcentaje = isVisibilidadCeldaNuevoRelacionesProcesoPreciosPorcentaje; } public Boolean getIsVisibilidadCeldaModificarProcesoPreciosPorcentaje() { return isVisibilidadCeldaModificarProcesoPreciosPorcentaje; } public void setIsVisibilidadCeldaModificarProcesoPreciosPorcentaje(Boolean isVisibilidadCeldaModificarProcesoPreciosPorcentaje) { this.isVisibilidadCeldaModificarProcesoPreciosPorcentaje = isVisibilidadCeldaModificarProcesoPreciosPorcentaje; } public Boolean getIsVisibilidadCeldaActualizarProcesoPreciosPorcentaje() { return isVisibilidadCeldaActualizarProcesoPreciosPorcentaje; } public void setIsVisibilidadCeldaActualizarProcesoPreciosPorcentaje(Boolean isVisibilidadCeldaActualizarProcesoPreciosPorcentaje) { this.isVisibilidadCeldaActualizarProcesoPreciosPorcentaje = isVisibilidadCeldaActualizarProcesoPreciosPorcentaje; } public Boolean getIsVisibilidadCeldaEliminarProcesoPreciosPorcentaje() { return isVisibilidadCeldaEliminarProcesoPreciosPorcentaje; } public void setIsVisibilidadCeldaEliminarProcesoPreciosPorcentaje(Boolean isVisibilidadCeldaEliminarProcesoPreciosPorcentaje) { this.isVisibilidadCeldaEliminarProcesoPreciosPorcentaje = isVisibilidadCeldaEliminarProcesoPreciosPorcentaje; } public Boolean getIsVisibilidadCeldaCancelarProcesoPreciosPorcentaje() { return isVisibilidadCeldaCancelarProcesoPreciosPorcentaje; } public void setIsVisibilidadCeldaCancelarProcesoPreciosPorcentaje(Boolean isVisibilidadCeldaCancelarProcesoPreciosPorcentaje) { this.isVisibilidadCeldaCancelarProcesoPreciosPorcentaje = isVisibilidadCeldaCancelarProcesoPreciosPorcentaje; } public Boolean getIsVisibilidadCeldaGuardarProcesoPreciosPorcentaje() { return isVisibilidadCeldaGuardarProcesoPreciosPorcentaje; } public void setIsVisibilidadCeldaGuardarProcesoPreciosPorcentaje(Boolean isVisibilidadCeldaGuardarProcesoPreciosPorcentaje) { this.isVisibilidadCeldaGuardarProcesoPreciosPorcentaje = isVisibilidadCeldaGuardarProcesoPreciosPorcentaje; } public Boolean getIsVisibilidadCeldaGuardarCambiosProcesoPreciosPorcentaje() { return isVisibilidadCeldaGuardarCambiosProcesoPreciosPorcentaje; } public void setIsVisibilidadCeldaGuardarCambiosProcesoPreciosPorcentaje(Boolean isVisibilidadCeldaGuardarCambiosProcesoPreciosPorcentaje) { this.isVisibilidadCeldaGuardarCambiosProcesoPreciosPorcentaje = isVisibilidadCeldaGuardarCambiosProcesoPreciosPorcentaje; } public ProcesoPreciosPorcentajeSessionBean getprocesopreciosporcentajeSessionBean() { return this.procesopreciosporcentajeSessionBean; } public void setprocesopreciosporcentajeSessionBean(ProcesoPreciosPorcentajeSessionBean procesopreciosporcentajeSessionBean) { this.procesopreciosporcentajeSessionBean=procesopreciosporcentajeSessionBean; } public Boolean getisVisibilidadBusquedaProcesoPreciosPorcentaje() { return this.isVisibilidadBusquedaProcesoPreciosPorcentaje; } public void setisVisibilidadBusquedaProcesoPreciosPorcentaje(Boolean isVisibilidadBusquedaProcesoPreciosPorcentaje) { this.isVisibilidadBusquedaProcesoPreciosPorcentaje=isVisibilidadBusquedaProcesoPreciosPorcentaje; } public Boolean getisVisibilidadFK_IdBodega() { return this.isVisibilidadFK_IdBodega; } public void setisVisibilidadFK_IdBodega(Boolean isVisibilidadFK_IdBodega) { this.isVisibilidadFK_IdBodega=isVisibilidadFK_IdBodega; } public Boolean getisVisibilidadFK_IdEmpresa() { return this.isVisibilidadFK_IdEmpresa; } public void setisVisibilidadFK_IdEmpresa(Boolean isVisibilidadFK_IdEmpresa) { this.isVisibilidadFK_IdEmpresa=isVisibilidadFK_IdEmpresa; } public Boolean getisVisibilidadFK_IdLinea() { return this.isVisibilidadFK_IdLinea; } public void setisVisibilidadFK_IdLinea(Boolean isVisibilidadFK_IdLinea) { this.isVisibilidadFK_IdLinea=isVisibilidadFK_IdLinea; } public Boolean getisVisibilidadFK_IdLineaCategoria() { return this.isVisibilidadFK_IdLineaCategoria; } public void setisVisibilidadFK_IdLineaCategoria(Boolean isVisibilidadFK_IdLineaCategoria) { this.isVisibilidadFK_IdLineaCategoria=isVisibilidadFK_IdLineaCategoria; } public Boolean getisVisibilidadFK_IdLineaGrupo() { return this.isVisibilidadFK_IdLineaGrupo; } public void setisVisibilidadFK_IdLineaGrupo(Boolean isVisibilidadFK_IdLineaGrupo) { this.isVisibilidadFK_IdLineaGrupo=isVisibilidadFK_IdLineaGrupo; } public Boolean getisVisibilidadFK_IdLineaMarca() { return this.isVisibilidadFK_IdLineaMarca; } public void setisVisibilidadFK_IdLineaMarca(Boolean isVisibilidadFK_IdLineaMarca) { this.isVisibilidadFK_IdLineaMarca=isVisibilidadFK_IdLineaMarca; } public Boolean getisVisibilidadFK_IdProducto() { return this.isVisibilidadFK_IdProducto; } public void setisVisibilidadFK_IdProducto(Boolean isVisibilidadFK_IdProducto) { this.isVisibilidadFK_IdProducto=isVisibilidadFK_IdProducto; } public Boolean getisVisibilidadFK_IdSucursal() { return this.isVisibilidadFK_IdSucursal; } public void setisVisibilidadFK_IdSucursal(Boolean isVisibilidadFK_IdSucursal) { this.isVisibilidadFK_IdSucursal=isVisibilidadFK_IdSucursal; } public void setVariablesFormularioToObjetoActualForeignKeysProcesoPreciosPorcentaje(ProcesoPreciosPorcentaje procesopreciosporcentaje)throws Exception { try { this.setActualParaGuardarBodegaForeignKey(procesopreciosporcentaje,null); this.setActualParaGuardarProductoForeignKey(procesopreciosporcentaje,null); this.setActualParaGuardarEmpresaForeignKey(procesopreciosporcentaje,null); this.setActualParaGuardarSucursalForeignKey(procesopreciosporcentaje,null); this.setActualParaGuardarLineaForeignKey(procesopreciosporcentaje,null); this.setActualParaGuardarLineaGrupoForeignKey(procesopreciosporcentaje,null); this.setActualParaGuardarLineaCategoriaForeignKey(procesopreciosporcentaje,null); this.setActualParaGuardarLineaMarcaForeignKey(procesopreciosporcentaje,null); } catch(Exception e) { throw e; } } public void cargarLicenciaCliente(DatosCliente datosCliente) throws Exception { Boolean existe=false; try { InputStream reportFile=null; String sPath=this.parametroGeneralUsuario.getpath_exportar()+"erp_bydan/license/license.xml"; reportFile = new FileInputStream(sPath); Document documentBuilder=null; if(this.constantes2.DOCUMENT_BUILDER==null) { documentBuilder=Funciones2.parseXml(reportFile); } else { documentBuilder=this.constantes2.DOCUMENT_BUILDER; } //GlobalSeguridad.readXml(documentBuilder); String sNamePCServerLicencia=""; String sClaveSistemaLicencia=""; Date dFechaServerLicencia=null; //CARGAR ELEMENTOS DE LICENCIA NodeList nodeList = documentBuilder.getElementsByTagName("Licencia"); for (int iIndice = 0; iIndice < nodeList.getLength(); iIndice++) { Node node = nodeList.item(iIndice); if (node.getNodeType() == Node.ELEMENT_NODE) { Element element = (Element) node; sNamePCServerLicencia=element.getElementsByTagName("NombrePc").item(0).getTextContent(); sClaveSistemaLicencia=element.getElementsByTagName("ClaveSistema").item(0).getTextContent(); existe=true; break; } } if(existe) { datosCliente.setsClaveSistema(sClaveSistemaLicencia); if(!datosCliente.getsNamePCServer().equals(sNamePCServerLicencia) && !datosCliente.getsNamePCServer().equals("")) { datosCliente.setsNamePCServer(sNamePCServerLicencia); } } else { throw new Exception("NO EXISTE LICENCIA O NO ESTA BIEN FORMADO"); } } catch(Exception e) { throw new Exception("NO EXISTE LICENCIA O NO ESTA BIEN FORMADO"); } } public void cargarDatosCliente() throws Exception { String sPrimerMacAddress=""; String sHostName=""; String sHostIp=""; String sHostUser=""; sPrimerMacAddress=FuncionesNetwork.getPrimerMacAddress(); sHostName=FuncionesNetwork.getHostName(); sHostIp=FuncionesNetwork.getHostIp(); sHostUser=FuncionesNetwork.getHostUser(); this.datosCliente=new DatosCliente(); if(lIdUsuarioSesion!=null){datosCliente.setIdUsuario(this.lIdUsuarioSesion);} //SERVIDOR WEB Y TALVEZ SERVIDOR SWING WINDOWS this.datosCliente.setsUsuarioPCServer(sHostUser); this.datosCliente.setsNamePCServer(sHostName); this.datosCliente.setsIPPCServer(sHostIp); this.datosCliente.setsMacAddressPCServer(sPrimerMacAddress); //CLIENTE SWING WINDOWS this.datosCliente.setIsClienteWeb(false); this.datosCliente.setsUsuarioPC(sHostUser); this.datosCliente.setsNamePC(sHostName); this.datosCliente.setsIPPC(sHostIp); this.datosCliente.setsMacAddressPC(sPrimerMacAddress); //this.cargarLicenciaCliente(this.datosCliente); } public void bugActualizarReferenciaActual(ProcesoPreciosPorcentaje procesopreciosporcentaje,ProcesoPreciosPorcentaje procesopreciosporcentajeAux) throws Exception { //ARCHITECTURE //EL ID NEGATIVO GUARDADO EN ORIGINAL SIRVE PARA VERIFICAR Y ACTUALIZAR EL REGISTRO NUEVO (ID,VERSIONROW) this.setCamposBaseDesdeOriginalProcesoPreciosPorcentaje(procesopreciosporcentaje); //POR BUG: EL OBJETO ACTUAL SE PERDIA, POR LO QUE SE GUARDA TAMBIEN VALORES EN AUX Y LUEGO DESPUES DEL MENSAJE SE HACE REFERENCIA EL OBJETO ACTUAL AL AUX procesopreciosporcentajeAux.setId(procesopreciosporcentaje.getId()); procesopreciosporcentajeAux.setVersionRow(procesopreciosporcentaje.getVersionRow()); } public void ejecutarMantenimiento(MaintenanceType maintenanceType)throws Exception { } public void actualizarRelaciones(ProcesoPreciosPorcentaje procesopreciosporcentajeLocal) throws Exception { if(this.procesopreciosporcentajeSessionBean.getConGuardarRelaciones()) { if(Constantes.ISUSAEJBLOGICLAYER) { } else { } } } public void actualizarRelacionFkPadreActual(ProcesoPreciosPorcentaje procesopreciosporcentajeLocal) throws Exception { if(this.procesopreciosporcentajeSessionBean.getEsGuardarRelacionado()) { if(this.jInternalFrameParent.getClass().equals(BodegaDetalleFormJInternalFrame.class)) { BodegaBeanSwingJInternalFrame bodegaBeanSwingJInternalFrameLocal=(BodegaBeanSwingJInternalFrame) ((BodegaDetalleFormJInternalFrame) this.jInternalFrameParent).jInternalFrameParent; bodegaBeanSwingJInternalFrameLocal.setVariablesFormularioToObjetoActualTodoBodega(bodegaBeanSwingJInternalFrameLocal.getbodega(),true); bodegaBeanSwingJInternalFrameLocal.actualizarLista(bodegaBeanSwingJInternalFrameLocal.bodega,this.bodegasForeignKey); bodegaBeanSwingJInternalFrameLocal.actualizarRelaciones(bodegaBeanSwingJInternalFrameLocal.bodega); procesopreciosporcentajeLocal.setBodega(bodegaBeanSwingJInternalFrameLocal.bodega); this.addItemDefectoCombosForeignKeyBodega(); this.cargarCombosFrameBodegasForeignKey("Formulario"); this.setActualBodegaForeignKey(bodegaBeanSwingJInternalFrameLocal.bodega.getId(),false,"Formulario"); } else if(this.jInternalFrameParent.getClass().equals(ProductoDetalleFormJInternalFrame.class)) { ProductoBeanSwingJInternalFrame productoBeanSwingJInternalFrameLocal=(ProductoBeanSwingJInternalFrame) ((ProductoDetalleFormJInternalFrame) this.jInternalFrameParent).jInternalFrameParent; productoBeanSwingJInternalFrameLocal.setVariablesFormularioToObjetoActualTodoProducto(productoBeanSwingJInternalFrameLocal.getproducto(),true); productoBeanSwingJInternalFrameLocal.actualizarLista(productoBeanSwingJInternalFrameLocal.producto,this.productosForeignKey); productoBeanSwingJInternalFrameLocal.actualizarRelaciones(productoBeanSwingJInternalFrameLocal.producto); procesopreciosporcentajeLocal.setProducto(productoBeanSwingJInternalFrameLocal.producto); this.addItemDefectoCombosForeignKeyProducto(); this.cargarCombosFrameProductosForeignKey("Formulario"); this.setActualProductoForeignKey(productoBeanSwingJInternalFrameLocal.producto.getId(),false,"Formulario"); } else if(this.jInternalFrameParent.getClass().equals(EmpresaDetalleFormJInternalFrame.class)) { EmpresaBeanSwingJInternalFrame empresaBeanSwingJInternalFrameLocal=(EmpresaBeanSwingJInternalFrame) ((EmpresaDetalleFormJInternalFrame) this.jInternalFrameParent).jInternalFrameParent; empresaBeanSwingJInternalFrameLocal.setVariablesFormularioToObjetoActualTodoEmpresa(empresaBeanSwingJInternalFrameLocal.getempresa(),true); empresaBeanSwingJInternalFrameLocal.actualizarLista(empresaBeanSwingJInternalFrameLocal.empresa,this.empresasForeignKey); empresaBeanSwingJInternalFrameLocal.actualizarRelaciones(empresaBeanSwingJInternalFrameLocal.empresa); procesopreciosporcentajeLocal.setEmpresa(empresaBeanSwingJInternalFrameLocal.empresa); this.addItemDefectoCombosForeignKeyEmpresa(); this.cargarCombosFrameEmpresasForeignKey("Formulario"); this.setActualEmpresaForeignKey(empresaBeanSwingJInternalFrameLocal.empresa.getId(),false,"Formulario"); } else if(this.jInternalFrameParent.getClass().equals(SucursalDetalleFormJInternalFrame.class)) { SucursalBeanSwingJInternalFrame sucursalBeanSwingJInternalFrameLocal=(SucursalBeanSwingJInternalFrame) ((SucursalDetalleFormJInternalFrame) this.jInternalFrameParent).jInternalFrameParent; sucursalBeanSwingJInternalFrameLocal.setVariablesFormularioToObjetoActualTodoSucursal(sucursalBeanSwingJInternalFrameLocal.getsucursal(),true); sucursalBeanSwingJInternalFrameLocal.actualizarLista(sucursalBeanSwingJInternalFrameLocal.sucursal,this.sucursalsForeignKey); sucursalBeanSwingJInternalFrameLocal.actualizarRelaciones(sucursalBeanSwingJInternalFrameLocal.sucursal); procesopreciosporcentajeLocal.setSucursal(sucursalBeanSwingJInternalFrameLocal.sucursal); this.addItemDefectoCombosForeignKeySucursal(); this.cargarCombosFrameSucursalsForeignKey("Formulario"); this.setActualSucursalForeignKey(sucursalBeanSwingJInternalFrameLocal.sucursal.getId(),false,"Formulario"); } else if(this.jInternalFrameParent.getClass().equals(LineaDetalleFormJInternalFrame.class)) { LineaBeanSwingJInternalFrame lineaBeanSwingJInternalFrameLocal=(LineaBeanSwingJInternalFrame) ((LineaDetalleFormJInternalFrame) this.jInternalFrameParent).jInternalFrameParent; lineaBeanSwingJInternalFrameLocal.setVariablesFormularioToObjetoActualTodoLinea(lineaBeanSwingJInternalFrameLocal.getlinea(),true); lineaBeanSwingJInternalFrameLocal.actualizarLista(lineaBeanSwingJInternalFrameLocal.linea,this.lineasForeignKey); lineaBeanSwingJInternalFrameLocal.actualizarRelaciones(lineaBeanSwingJInternalFrameLocal.linea); procesopreciosporcentajeLocal.setLinea(lineaBeanSwingJInternalFrameLocal.linea); this.addItemDefectoCombosForeignKeyLinea(); this.cargarCombosFrameLineasForeignKey("Formulario"); this.setActualLineaForeignKey(lineaBeanSwingJInternalFrameLocal.linea.getId(),false,"Formulario"); } else if(this.jInternalFrameParent.getClass().equals(LineaDetalleFormJInternalFrame.class)) { LineaBeanSwingJInternalFrame lineagrupoBeanSwingJInternalFrameLocal=(LineaBeanSwingJInternalFrame) ((LineaDetalleFormJInternalFrame) this.jInternalFrameParent).jInternalFrameParent; lineagrupoBeanSwingJInternalFrameLocal.setVariablesFormularioToObjetoActualTodoLinea(lineagrupoBeanSwingJInternalFrameLocal.getlinea(),true); lineagrupoBeanSwingJInternalFrameLocal.actualizarLista(lineagrupoBeanSwingJInternalFrameLocal.linea,this.lineagruposForeignKey); lineagrupoBeanSwingJInternalFrameLocal.actualizarRelaciones(lineagrupoBeanSwingJInternalFrameLocal.linea); procesopreciosporcentajeLocal.setLineaGrupo(lineagrupoBeanSwingJInternalFrameLocal.linea); this.addItemDefectoCombosForeignKeyLineaGrupo(); this.cargarCombosFrameLineaGruposForeignKey("Formulario"); this.setActualLineaGrupoForeignKey(lineagrupoBeanSwingJInternalFrameLocal.linea.getId(),false,"Formulario"); } else if(this.jInternalFrameParent.getClass().equals(LineaDetalleFormJInternalFrame.class)) { LineaBeanSwingJInternalFrame lineacategoriaBeanSwingJInternalFrameLocal=(LineaBeanSwingJInternalFrame) ((LineaDetalleFormJInternalFrame) this.jInternalFrameParent).jInternalFrameParent; lineacategoriaBeanSwingJInternalFrameLocal.setVariablesFormularioToObjetoActualTodoLinea(lineacategoriaBeanSwingJInternalFrameLocal.getlinea(),true); lineacategoriaBeanSwingJInternalFrameLocal.actualizarLista(lineacategoriaBeanSwingJInternalFrameLocal.linea,this.lineacategoriasForeignKey); lineacategoriaBeanSwingJInternalFrameLocal.actualizarRelaciones(lineacategoriaBeanSwingJInternalFrameLocal.linea); procesopreciosporcentajeLocal.setLineaCategoria(lineacategoriaBeanSwingJInternalFrameLocal.linea); this.addItemDefectoCombosForeignKeyLineaCategoria(); this.cargarCombosFrameLineaCategoriasForeignKey("Formulario"); this.setActualLineaCategoriaForeignKey(lineacategoriaBeanSwingJInternalFrameLocal.linea.getId(),false,"Formulario"); } else if(this.jInternalFrameParent.getClass().equals(LineaDetalleFormJInternalFrame.class)) { LineaBeanSwingJInternalFrame lineamarcaBeanSwingJInternalFrameLocal=(LineaBeanSwingJInternalFrame) ((LineaDetalleFormJInternalFrame) this.jInternalFrameParent).jInternalFrameParent; lineamarcaBeanSwingJInternalFrameLocal.setVariablesFormularioToObjetoActualTodoLinea(lineamarcaBeanSwingJInternalFrameLocal.getlinea(),true); lineamarcaBeanSwingJInternalFrameLocal.actualizarLista(lineamarcaBeanSwingJInternalFrameLocal.linea,this.lineamarcasForeignKey); lineamarcaBeanSwingJInternalFrameLocal.actualizarRelaciones(lineamarcaBeanSwingJInternalFrameLocal.linea); procesopreciosporcentajeLocal.setLineaMarca(lineamarcaBeanSwingJInternalFrameLocal.linea); this.addItemDefectoCombosForeignKeyLineaMarca(); this.cargarCombosFrameLineaMarcasForeignKey("Formulario"); this.setActualLineaMarcaForeignKey(lineamarcaBeanSwingJInternalFrameLocal.linea.getId(),false,"Formulario"); } } } public Boolean validarProcesoPreciosPorcentajeActual() throws Exception { Boolean estaValidado=false; this.inicializarInvalidValues(); /* int intSelectedRow = this.jTableDatosProcesoPreciosPorcentaje.getSelectedRow(); //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentaje =(ProcesoPreciosPorcentaje) this.procesopreciosporcentajeLogic.getProcesoPreciosPorcentajes().toArray()[this.jTableDatosProcesoPreciosPorcentaje.convertRowIndexToModel(intSelectedRow)]; } else if(Constantes.ISUSAEJBREMOTE ||Constantes.ISUSAEJBHOME) { this.procesopreciosporcentaje =(ProcesoPreciosPorcentaje) this.procesopreciosporcentajes.toArray()[this.jTableDatosProcesoPreciosPorcentaje.convertRowIndexToModel(intSelectedRow)]; } //ARCHITECTURE */ this.invalidValues = procesopreciosporcentajeValidator.getInvalidValues(this.procesopreciosporcentaje); if(this.invalidValues==null || this.invalidValues.length<=0) { estaValidado=true; } else { this.mostrarInvalidValues(); } return estaValidado; } public void actualizarLista(ProcesoPreciosPorcentaje procesopreciosporcentaje,List<ProcesoPreciosPorcentaje> procesopreciosporcentajes) throws Exception { } public void actualizarSelectedLista(ProcesoPreciosPorcentaje procesopreciosporcentaje,List<ProcesoPreciosPorcentaje> procesopreciosporcentajes) throws Exception { try { ProcesoPreciosPorcentajeConstantesFunciones.actualizarSelectedLista(procesopreciosporcentaje,procesopreciosporcentajes); } catch(Exception e) { throw e; } } public Boolean tieneElementosSeleccionados() throws Exception { Boolean tiene=false; List<ProcesoPreciosPorcentaje> procesopreciosporcentajesLocal=null; try { //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { procesopreciosporcentajesLocal=this.procesopreciosporcentajeLogic.getProcesoPreciosPorcentajes(); } else if(Constantes.ISUSAEJBREMOTE || Constantes.ISUSAEJBHOME) { procesopreciosporcentajesLocal=this.procesopreciosporcentajes; } //ARCHITECTURE for(ProcesoPreciosPorcentaje procesopreciosporcentajeLocal:procesopreciosporcentajesLocal) { if(this.permiteMantenimiento(procesopreciosporcentajeLocal) && procesopreciosporcentajeLocal.getIsSelected()) { tiene=true; break; } } } catch(Exception e) { throw e; } return tiene; } public void mostrarInvalidValues() throws Exception { String sMensaje=""; for (InvalidValue invalidValue : this.invalidValues) { sMensaje+="\r\n"+ProcesoPreciosPorcentajeConstantesFunciones.getProcesoPreciosPorcentajeLabelDesdeNombre(invalidValue.getPropertyName())+"->"+invalidValue.getMessage(); //MOSTRAR CAMPOS INVALIDOS if(invalidValue.getPropertyName().equals(ProcesoPreciosPorcentajeConstantesFunciones.CODIGO)) {FuncionesSwing.mostrarCampoMensajeInvalido(false,this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jLabelcodigoProcesoPreciosPorcentaje,invalidValue.getMessage());} if(invalidValue.getPropertyName().equals(ProcesoPreciosPorcentajeConstantesFunciones.NOMBRE)) {FuncionesSwing.mostrarCampoMensajeInvalido(false,this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jLabelnombreProcesoPreciosPorcentaje,invalidValue.getMessage());} if(invalidValue.getPropertyName().equals(ProcesoPreciosPorcentajeConstantesFunciones.CODIGOPRODUCTO)) {FuncionesSwing.mostrarCampoMensajeInvalido(false,this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jLabelcodigo_productoProcesoPreciosPorcentaje,invalidValue.getMessage());} if(invalidValue.getPropertyName().equals(ProcesoPreciosPorcentajeConstantesFunciones.NOMBREPRODUCTO)) {FuncionesSwing.mostrarCampoMensajeInvalido(false,this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jLabelnombre_productoProcesoPreciosPorcentaje,invalidValue.getMessage());} if(invalidValue.getPropertyName().equals(ProcesoPreciosPorcentajeConstantesFunciones.PRECIO)) {FuncionesSwing.mostrarCampoMensajeInvalido(false,this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jLabelprecioProcesoPreciosPorcentaje,invalidValue.getMessage());} if(invalidValue.getPropertyName().equals(ProcesoPreciosPorcentajeConstantesFunciones.PORCENTAJE)) {FuncionesSwing.mostrarCampoMensajeInvalido(false,this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jLabelporcentajeProcesoPreciosPorcentaje,invalidValue.getMessage());} } if(!sMensaje.equals("")) { //JOptionPane.showMessageDialog(this,sMensaje,"VALIDACION ",JOptionPane.ERROR_MESSAGE); throw new Exception(sMensaje); } /* System.out.println(invalidValue); System.out.println("message=" + invalidValue.getMessage()); System.out.println("propertyName=" + invalidValue.getPropertyName()); System.out.println("propertyPath=" + invalidValue.getPropertyPath()); System.out.println("value=" + invalidValue.getValue()); */ } public void inicializarInvalidValues() throws Exception { String sMensaje=""; if(this.jInternalFrameDetalleFormProcesoPreciosPorcentaje!=null) { //MOSTRAR CAMPOS INVALIDOS FuncionesSwing.mostrarCampoMensajeInvalido(true,this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jLabelcodigoProcesoPreciosPorcentaje,""); FuncionesSwing.mostrarCampoMensajeInvalido(true,this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jLabelnombreProcesoPreciosPorcentaje,""); FuncionesSwing.mostrarCampoMensajeInvalido(true,this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jLabelcodigo_productoProcesoPreciosPorcentaje,""); FuncionesSwing.mostrarCampoMensajeInvalido(true,this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jLabelnombre_productoProcesoPreciosPorcentaje,""); FuncionesSwing.mostrarCampoMensajeInvalido(true,this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jLabelprecioProcesoPreciosPorcentaje,""); FuncionesSwing.mostrarCampoMensajeInvalido(true,this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jLabelporcentajeProcesoPreciosPorcentaje,""); } } public void actualizarObjetoPadreFk(String sTipo) throws Exception { if(sTipo.equals("XXXAuxiliar")) { } } public void nuevoPreparar() throws Exception { this.nuevoPreparar(false); } public void nuevoPreparar(Boolean esNuevoGuardarCambios) throws Exception { this.iIdNuevoProcesoPreciosPorcentaje--; this.procesopreciosporcentajeAux=new ProcesoPreciosPorcentaje(); this.procesopreciosporcentajeAux.setId(this.iIdNuevoProcesoPreciosPorcentaje); this.procesopreciosporcentajeAux.setIsChanged(true); //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.getProcesoPreciosPorcentajes().add(this.procesopreciosporcentajeAux); } else if(Constantes.ISUSAEJBREMOTE || Constantes.ISUSAEJBHOME) { this.procesopreciosporcentajes.add(this.procesopreciosporcentajeAux); } //ARCHITECTURE this.procesopreciosporcentaje=this.procesopreciosporcentajeAux; if(ProcesoPreciosPorcentajeJInternalFrame.ISBINDING_MANUAL_TABLA) { this.setVariablesObjetoActualToFormularioProcesoPreciosPorcentaje(this.procesopreciosporcentaje); this.setVariablesObjetoActualToFormularioForeignKeyProcesoPreciosPorcentaje(this.procesopreciosporcentaje); } //this.setDefaultControlesProcesoPreciosPorcentaje(); this.inicializarInvalidValues(); //SELECCIONA ITEM DEFECTO-->SET O SELECTED INDEX this.setItemDefectoCombosForeignKeyProcesoPreciosPorcentaje(); //INICIALIZA VARIABLES COMBOS GLOBALES A FORMULARIO(ParametroGeneralUsuario) this.setVariablesGlobalesCombosForeignKeyProcesoPreciosPorcentaje(); //INICIALIZA VARIABLES COMBOS GLOBALES AUXILIARES A FORMULARIO(Anio,Mes) //this.setVariablesGlobalesAuxiliaresCombosForeignKeyProcesoPreciosPorcentaje(); //SI TIENE FOREIGN KEY CON CAMPO esDefecto=true, SE ACTUALIZA A OBJETO ACTUAL this.setVariablesForeignKeyObjetoBeanDefectoActualToObjetoActualProcesoPreciosPorcentaje(this.procesopreciosporcentajeBean,this.procesopreciosporcentaje,false,false); //ACTUALIZA VALORES PARA EL OBJETO ACTUAL ANTES DE ENVIARLO A ACTUALIZAR this.setVariablesFormularioToObjetoActualForeignKeysProcesoPreciosPorcentaje(this.procesopreciosporcentaje); ArrayList<Classe> classes=new ArrayList<Classe>(); //ACTUALIZA VARIABLES DEFECTO DESDE LOGIC A RETURN GENERAL Y LUEGO A BEAN //this.setVariablesObjetoReturnGeneralToBeanProcesoPreciosPorcentaje(this.procesopreciosporcentajeReturnGeneral,this.procesopreciosporcentajeBean,false); if(this.procesopreciosporcentajeReturnGeneral.getConRecargarPropiedades()) { //INICIALIZA VARIABLES COMBOS NORMALES (FK) this.setVariablesObjetoActualToFormularioForeignKeyProcesoPreciosPorcentaje(this.procesopreciosporcentajeReturnGeneral.getProcesoPreciosPorcentaje()); //INICIALIZA VARIABLES NORMALES A FORMULARIO(SIN FK) this.setVariablesObjetoActualToFormularioProcesoPreciosPorcentaje(this.procesopreciosporcentajeReturnGeneral.getProcesoPreciosPorcentaje()); } if(this.procesopreciosporcentajeReturnGeneral.getConRecargarRelaciones()) { //INICIALIZA VARIABLES RELACIONES A FORMULARIO this.setVariablesRelacionesObjetoActualToFormularioProcesoPreciosPorcentaje(this.procesopreciosporcentajeReturnGeneral.getProcesoPreciosPorcentaje(),classes);//this.procesopreciosporcentajeBean); } //ACTUALIZA VARIABLES FORMULARIO A OBJETO ACTUAL (PARA NUEVO TABLA O GUARDAR CAMBIOS if(esNuevoGuardarCambios) { this.setVariablesFormularioToObjetoActualProcesoPreciosPorcentaje(this.procesopreciosporcentaje,false); } //INICIALIZA VARIABLES COMBOS DEFAULT DEL PROYECTO(|DEFAULT para FK) //this.setVariablesDefaultCombosForeignKeyProcesoPreciosPorcentaje(); //INICIALIZA VARIABLES COMBOS PARAMETRO DEL PROYECTO(|VALORPARAM Era para ParametroModulo, ahora en logic) //this.setVariablesParametroCombosForeignKeyProcesoPreciosPorcentaje(); if(!esNuevoGuardarCambios) { //INICIALIZA VARIABLES POR OPCION MENU this.arrDatoGeneral= new ArrayList<DatoGeneral>(); this.arrDatoGeneralNo= new ArrayList<String>(); ProcesoPreciosPorcentajeBeanSwingJInternalFrameAdditional.RecargarFormProcesoPreciosPorcentaje(this,"NUEVO_PREPARAR","",this.arrDatoGeneral); //NO FUNCIONA BINDINGS this.inicializarActualizarBindingProcesoPreciosPorcentaje(false); if(procesopreciosporcentajeSessionBean.getConGuardarRelaciones()) { //DEBERIA YA ESTAR CARGADO LOS COMBOS Y SI SE NECESITA ALGO MAS SE DEBE CREAR FUNCION LIMITADA //SI DEBE TRAER Y RESETEAR TABLA } //SI ES MANUAL if(ProcesoPreciosPorcentajeJInternalFrame.ISBINDING_MANUAL) { //this.inicializarActualizarBindingManualProcesoPreciosPorcentaje(); } this.actualizarVisualTableDatosProcesoPreciosPorcentaje(); this.jTableDatosProcesoPreciosPorcentaje.setRowSelectionInterval(this.getIndiceNuevoProcesoPreciosPorcentaje(), this.getIndiceNuevoProcesoPreciosPorcentaje()); this.seleccionarFilaTablaProcesoPreciosPorcentajeActual(); this.actualizarEstadoCeldasBotonesProcesoPreciosPorcentaje("a", isGuardarCambiosEnLote, isEsMantenimientoRelacionado); } } public void habilitarDeshabilitarControlesProcesoPreciosPorcentaje(Boolean isHabilitar) throws Exception { this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jTextAreacodigoProcesoPreciosPorcentaje.setEnabled(isHabilitar && this.procesopreciosporcentajeConstantesFunciones.activarcodigoProcesoPreciosPorcentaje); this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jTextAreanombreProcesoPreciosPorcentaje.setEnabled(isHabilitar && this.procesopreciosporcentajeConstantesFunciones.activarnombreProcesoPreciosPorcentaje); this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jTextFieldcodigo_productoProcesoPreciosPorcentaje.setEnabled(isHabilitar && this.procesopreciosporcentajeConstantesFunciones.activarcodigo_productoProcesoPreciosPorcentaje); this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jTextAreanombre_productoProcesoPreciosPorcentaje.setEnabled(isHabilitar && this.procesopreciosporcentajeConstantesFunciones.activarnombre_productoProcesoPreciosPorcentaje); this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jTextFieldprecioProcesoPreciosPorcentaje.setEnabled(isHabilitar && this.procesopreciosporcentajeConstantesFunciones.activarprecioProcesoPreciosPorcentaje); this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jTextFieldporcentajeProcesoPreciosPorcentaje.setEnabled(isHabilitar && this.procesopreciosporcentajeConstantesFunciones.activarporcentajeProcesoPreciosPorcentaje); this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jComboBoxid_bodegaProcesoPreciosPorcentaje.setEnabled(isHabilitar && this.procesopreciosporcentajeConstantesFunciones.activarid_bodegaProcesoPreciosPorcentaje); this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jComboBoxid_productoProcesoPreciosPorcentaje.setEnabled(isHabilitar && this.procesopreciosporcentajeConstantesFunciones.activarid_productoProcesoPreciosPorcentaje);// this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jComboBoxid_empresaProcesoPreciosPorcentaje.setEnabled(isHabilitar && this.procesopreciosporcentajeConstantesFunciones.activarid_empresaProcesoPreciosPorcentaje);// this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jComboBoxid_sucursalProcesoPreciosPorcentaje.setEnabled(isHabilitar && this.procesopreciosporcentajeConstantesFunciones.activarid_sucursalProcesoPreciosPorcentaje); this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jComboBoxid_lineaProcesoPreciosPorcentaje.setEnabled(isHabilitar && this.procesopreciosporcentajeConstantesFunciones.activarid_lineaProcesoPreciosPorcentaje); this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jComboBoxid_linea_grupoProcesoPreciosPorcentaje.setEnabled(isHabilitar && this.procesopreciosporcentajeConstantesFunciones.activarid_linea_grupoProcesoPreciosPorcentaje); this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jComboBoxid_linea_categoriaProcesoPreciosPorcentaje.setEnabled(isHabilitar && this.procesopreciosporcentajeConstantesFunciones.activarid_linea_categoriaProcesoPreciosPorcentaje); this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jComboBoxid_linea_marcaProcesoPreciosPorcentaje.setEnabled(isHabilitar && this.procesopreciosporcentajeConstantesFunciones.activarid_linea_marcaProcesoPreciosPorcentaje); }; public void setDefaultControlesProcesoPreciosPorcentaje() throws Exception { }; public void habilitarDeshabilitarTipoMantenimientoProcesoPreciosPorcentaje(Boolean esRelaciones) throws Exception { if(esRelaciones) { //this.procesopreciosporcentajeSessionBean.setConGuardarRelaciones(true); this.procesopreciosporcentajeSessionBean.setEstaModoGuardarRelaciones(true); this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jTabbedPaneRelacionesProcesoPreciosPorcentaje.setVisible(true); } else { //this.procesopreciosporcentajeSessionBean.setConGuardarRelaciones(false); this.procesopreciosporcentajeSessionBean.setEstaModoGuardarRelaciones(false); this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jTabbedPaneRelacionesProcesoPreciosPorcentaje.setVisible(false); } }; public int getIndiceNuevoProcesoPreciosPorcentaje() throws Exception { int iIndice=0; Boolean existe=false; //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { for(ProcesoPreciosPorcentaje procesopreciosporcentajeAux:this.procesopreciosporcentajeLogic.getProcesoPreciosPorcentajes()) { if(procesopreciosporcentajeAux.getId().equals(this.iIdNuevoProcesoPreciosPorcentaje)) { existe=true; break; } iIndice++; } } else if(Constantes.ISUSAEJBREMOTE || Constantes.ISUSAEJBHOME) { for(ProcesoPreciosPorcentaje procesopreciosporcentajeAux:this.procesopreciosporcentajes) { if(procesopreciosporcentajeAux.getId().equals(this.iIdNuevoProcesoPreciosPorcentaje)) { existe=true; break; } iIndice++; } } //ARCHITECTURE if(!existe) { //SI NO EXISTE TOMA LA ULTIMA FILA iIndice=iIndice-1; } return iIndice; } public int getIndiceActualProcesoPreciosPorcentaje(ProcesoPreciosPorcentaje procesopreciosporcentaje,Integer iIndiceActual) throws Exception { Integer iIndice=0; Boolean existe=false; //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { for(ProcesoPreciosPorcentaje procesopreciosporcentajeAux:this.procesopreciosporcentajeLogic.getProcesoPreciosPorcentajes()) { if(procesopreciosporcentajeAux.getId().equals(procesopreciosporcentaje.getId())) { existe=true; break; } iIndice++; } } else if(Constantes.ISUSAEJBREMOTE || Constantes.ISUSAEJBHOME) { for(ProcesoPreciosPorcentaje procesopreciosporcentajeAux:this.procesopreciosporcentajes) { if(procesopreciosporcentajeAux.getId().equals(procesopreciosporcentaje.getId())) { existe=true; break; } iIndice++; } } //ARCHITECTURE if(!existe) { //SI NO EXISTE TOMA LA ULTIMA FILA iIndice=iIndiceActual; } return iIndice; } public void setCamposBaseDesdeOriginalProcesoPreciosPorcentaje(ProcesoPreciosPorcentaje procesopreciosporcentajeOriginal) throws Exception { Boolean existe=false; //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { for(ProcesoPreciosPorcentaje procesopreciosporcentajeAux:this.procesopreciosporcentajeLogic.getProcesoPreciosPorcentajes()) { if(procesopreciosporcentajeAux.getProcesoPreciosPorcentajeOriginal().getId().equals(procesopreciosporcentajeOriginal.getId())) { existe=true; procesopreciosporcentajeOriginal.setId(procesopreciosporcentajeAux.getId()); procesopreciosporcentajeOriginal.setVersionRow(procesopreciosporcentajeAux.getVersionRow()); break; } } } else if(Constantes.ISUSAEJBREMOTE || Constantes.ISUSAEJBHOME) { for(ProcesoPreciosPorcentaje procesopreciosporcentajeAux:this.procesopreciosporcentajes) { if(procesopreciosporcentajeAux.getProcesoPreciosPorcentajeOriginal().getId().equals(procesopreciosporcentajeOriginal.getId())) { existe=true; procesopreciosporcentajeOriginal.setId(procesopreciosporcentajeAux.getId()); procesopreciosporcentajeOriginal.setVersionRow(procesopreciosporcentajeAux.getVersionRow()); break; } } } //ARCHITECTURE if(!existe) { //SI NO EXISTE TOMA LA ULTIMA FILA } } public void cancelarNuevosProcesoPreciosPorcentaje(Boolean esParaCancelar) throws Exception { procesopreciosporcentajesAux=new ArrayList<ProcesoPreciosPorcentaje>(); procesopreciosporcentajeAux=new ProcesoPreciosPorcentaje(); if(!this.procesopreciosporcentajeSessionBean.getEsGuardarRelacionado()) { if(Constantes.ISUSAEJBLOGICLAYER) { for(ProcesoPreciosPorcentaje procesopreciosporcentajeAux:this.procesopreciosporcentajeLogic.getProcesoPreciosPorcentajes()) { if(procesopreciosporcentajeAux.getId()<0) { procesopreciosporcentajesAux.add(procesopreciosporcentajeAux); } } this.iIdNuevoProcesoPreciosPorcentaje=0L; this.procesopreciosporcentajeLogic.getProcesoPreciosPorcentajes().removeAll(procesopreciosporcentajesAux); } else if(Constantes.ISUSAEJBREMOTE||Constantes.ISUSAEJBHOME) { for(ProcesoPreciosPorcentaje procesopreciosporcentajeAux:this.procesopreciosporcentajes) { if(procesopreciosporcentajeAux.getId()<0) { procesopreciosporcentajesAux.add(procesopreciosporcentajeAux); } } this.iIdNuevoProcesoPreciosPorcentaje=0L; this.procesopreciosporcentajes.removeAll(procesopreciosporcentajesAux); } } else { if(Constantes.ISUSAEJBLOGICLAYER) { if(esParaCancelar && this.isEsNuevoProcesoPreciosPorcentaje && this.procesopreciosporcentajeLogic.getProcesoPreciosPorcentajes().size()>0 ) { procesopreciosporcentajeAux=this.procesopreciosporcentajeLogic.getProcesoPreciosPorcentajes().get(this.procesopreciosporcentajeLogic.getProcesoPreciosPorcentajes().size() - 1); if(procesopreciosporcentajeAux.getId()<0) { this.procesopreciosporcentajeLogic.getProcesoPreciosPorcentajes().remove(procesopreciosporcentajeAux); } } } else if(Constantes.ISUSAEJBREMOTE||Constantes.ISUSAEJBHOME) { if(esParaCancelar && this.isEsNuevoProcesoPreciosPorcentaje && this.procesopreciosporcentajes.size()>0) { procesopreciosporcentajeAux=this.procesopreciosporcentajes.get(this.procesopreciosporcentajes.size() - 1); if(procesopreciosporcentajeAux.getId()<0) { this.procesopreciosporcentajes.remove(procesopreciosporcentajeAux); } } } } } public void cancelarNuevoProcesoPreciosPorcentaje(Boolean esParaCancelar) throws Exception { if(Constantes.ISUSAEJBLOGICLAYER) { if(procesopreciosporcentaje.getId()<0) { this.procesopreciosporcentajeLogic.getProcesoPreciosPorcentajes().remove(this.procesopreciosporcentaje); } } else if(Constantes.ISUSAEJBREMOTE||Constantes.ISUSAEJBHOME) { if(procesopreciosporcentaje.getId()<0) { this.procesopreciosporcentajes.remove(this.procesopreciosporcentaje); } } } public void setEstadosInicialesProcesoPreciosPorcentaje(List<ProcesoPreciosPorcentaje> procesopreciosporcentajesAux) throws Exception { ProcesoPreciosPorcentajeConstantesFunciones.setEstadosInicialesProcesoPreciosPorcentaje(procesopreciosporcentajesAux); } public void setEstadosInicialesProcesoPreciosPorcentaje(ProcesoPreciosPorcentaje procesopreciosporcentajeAux) throws Exception { ProcesoPreciosPorcentajeConstantesFunciones.setEstadosInicialesProcesoPreciosPorcentaje(procesopreciosporcentajeAux); } public void nuevo() throws Exception { try { //ESTA VALIDADO EN FUNCION ACTUALIZAR //if(this.validarProcesoPreciosPorcentajeActual()) { this.ejecutarMantenimiento(MaintenanceType.NUEVO); this.actualizarEstadoCeldasBotonesProcesoPreciosPorcentaje("n", isGuardarCambiosEnLote, isEsMantenimientoRelacionado); //} } catch(Exception e) { throw e; //FuncionesSwing.manageException(this, e,logger,ProcesoPreciosPorcentajeConstantesFunciones.CLASSNAME); } } public void actualizar() throws Exception { try { if(this.validarProcesoPreciosPorcentajeActual()) { if(!this.isEsNuevoProcesoPreciosPorcentaje) { this.ejecutarMantenimiento(MaintenanceType.ACTUALIZAR); this.actualizarEstadoCeldasBotonesProcesoPreciosPorcentaje("n", isGuardarCambiosEnLote, isEsMantenimientoRelacionado); } else { this.nuevo(); this.isEsNuevoProcesoPreciosPorcentaje=false; } //SE CANCELA AL FINAL DEL PROCESO JBUTTONACTUALIZAR //this.cancelar(false); } } catch(Exception e) { throw e; //FuncionesSwing.manageException(this, e,logger,ProcesoPreciosPorcentajeConstantesFunciones.CLASSNAME); } } public void eliminar() throws Exception { try { if(this.validarProcesoPreciosPorcentajeActual()) { if(JOptionPane.showConfirmDialog(this, "ESTA SEGURO DE ELIMINAR EL/LA Proceso Precios Porcentaje ?", "MANTENIMIENTO DE Proceso Precios Porcentaje", JOptionPane.OK_CANCEL_OPTION) == 0) { this.ejecutarMantenimiento(MaintenanceType.ELIMINAR); this.actualizarEstadoCeldasBotonesProcesoPreciosPorcentaje("n", isGuardarCambiosEnLote, isEsMantenimientoRelacionado); } } } catch(Exception e) { throw e; //FuncionesSwing.manageException(this, e,logger,ProcesoPreciosPorcentajeConstantesFunciones.CLASSNAME); } } public void guardarCambios() throws Exception { try { this.ejecutarMantenimiento(MaintenanceType.GUARDARCAMBIOS); } catch(Exception e) { FuncionesSwing.manageException(this, e,logger,ProcesoPreciosPorcentajeConstantesFunciones.CLASSNAME); } } public void seleccionarAsignar(ProcesoPreciosPorcentaje procesopreciosporcentaje) throws Exception { ProcesoPreciosPorcentajeConstantesFunciones.seleccionarAsignar(this.procesopreciosporcentaje,procesopreciosporcentaje); } public void seleccionar() throws Exception { try { //ACTUALIZO EL PERMISO ACTUALIZAR CON EL PERMISO ACTUALIZAR ORIGINAL ESTE PERMISO SE UTILIZA PARA EL NUEVO TAMBIEN this.isPermisoActualizarProcesoPreciosPorcentaje=this.isPermisoActualizarOriginalProcesoPreciosPorcentaje; this.seleccionarAsignar(procesopreciosporcentaje); this.actualizarEstadoCeldasBotonesProcesoPreciosPorcentaje("ae", isGuardarCambiosEnLote, isEsMantenimientoRelacionado); } catch(Exception e) { FuncionesSwing.manageException(this, e,logger,ProcesoPreciosPorcentajeConstantesFunciones.CLASSNAME); } } public void seleccionarBusqueda(Long id) throws Exception { try { this.procesopreciosporcentajeSessionBean.setsFuncionBusquedaRapida(this.procesopreciosporcentajeSessionBean.getsFuncionBusquedaRapida().replace("TO_REPLACE", id.toString())); } catch(Exception e) { FuncionesSwing.manageException(this, e,logger,ProcesoPreciosPorcentajeConstantesFunciones.CLASSNAME); } } public void cancelar() throws Exception { this.cancelar(true); } public void cancelar(Boolean esParaCancelar) throws Exception { try { //SE UTILIZA COLUMNA ELIMINAR EN TABLA if(this.isEsNuevoProcesoPreciosPorcentaje) { //NO CANCELA TODOS NUEVOS POR FUNCIONALIDAD GUARDAR CAMBIOS //this.cancelarNuevosProcesoPreciosPorcentaje(esParaCancelar); this.cancelarNuevoProcesoPreciosPorcentaje(esParaCancelar); } this.procesopreciosporcentaje=new ProcesoPreciosPorcentaje(); this.inicializarProcesoPreciosPorcentaje(); this.actualizarEstadoCeldasBotonesProcesoPreciosPorcentaje("n", isGuardarCambiosEnLote, isEsMantenimientoRelacionado); } catch(Exception e) { FuncionesSwing.manageException(this, e,logger,ProcesoPreciosPorcentajeConstantesFunciones.CLASSNAME); } } public void inicializarProcesoPreciosPorcentaje() throws Exception { try { ProcesoPreciosPorcentajeConstantesFunciones.inicializarProcesoPreciosPorcentaje(this.procesopreciosporcentaje); } catch(Exception e) { throw e; } } public void anteriores()throws Exception { try { //this.iNumeroPaginacionPagina=this.iNumeroPaginacionPagina-this.iNumeroPaginacion; if(this.iNumeroPaginacionPagina-this.iNumeroPaginacion<this.iNumeroPaginacion) { this.iNumeroPaginacionPagina=0; } else { this.iNumeroPaginacionPagina=this.iNumeroPaginacionPagina-this.iNumeroPaginacion; } this.procesarBusqueda(this.sAccionBusqueda); } catch(Exception e) { FuncionesSwing.manageException(this, e,logger,ProcesoPreciosPorcentajeConstantesFunciones.CLASSNAME); } } public void siguientes()throws Exception { try { if(this.procesopreciosporcentajeLogic.getProcesoPreciosPorcentajes().size()>0) { this.iNumeroPaginacionPagina=this.iNumeroPaginacionPagina+this.iNumeroPaginacion; } this.procesarBusqueda(this.sAccionBusqueda); } catch(Exception e) { FuncionesSwing.manageException(this, e,logger,ProcesoPreciosPorcentajeConstantesFunciones.CLASSNAME); } } public void generarReporteProcesoPreciosPorcentajes(String sAccionBusqueda,List<ProcesoPreciosPorcentaje> procesopreciosporcentajesParaReportes) throws Exception { //HttpSession httpSession = httpServletRequest.getSession(); Long iIdUsuarioSesion=0L; if(usuarioActual==null) { this.usuarioActual=new Usuario(); } iIdUsuarioSesion=usuarioActual.getId(); String sPathReportes=""; InputStream reportFile=null; InputStream imageFile=null; imageFile=AuxiliarImagenes.class.getResourceAsStream("LogoReporte.jpg"); String sPathReporteFinal=""; if(!esReporteAccionProceso) { if(!this.sTipoReporte.equals("RELACIONES")) {//!isEsReporteRelaciones if(!this.esReporteDinamico) { sPathReporteFinal="ProcesoPreciosPorcentaje"+this.sTipoReporteExtra+"Design.jasper"; reportFile = AuxiliarReportes.class.getResourceAsStream(sPathReporteFinal); } else { sPathReporteFinal=this.sPathReporteDinamico; reportFile = new FileInputStream(sPathReporteFinal); } } else { sPathReporteFinal="ProcesoPreciosPorcentajeMasterRelaciones"+this.sTipoReporteExtra+"Design.jasper"; reportFile = AuxiliarReportes.class.getResourceAsStream(sPathReporteFinal); //sPathReportes=reportFile.getPath().replace("ProcesoPreciosPorcentajeMasterRelacionesDesign.jasper", ""); } } else { sPathReporteFinal="ProcesoPreciosPorcentaje"+this.sTipoReporteExtra+"Design.jasper"; reportFile = AuxiliarReportes.class.getResourceAsStream(sPathReporteFinal); } if(reportFile==null) { throw new JRRuntimeException(sPathReporteFinal+" no existe"); } String sUsuario=""; if(usuarioActual!=null) { sUsuario=usuarioActual.getuser_name(); } Map<String, Object> parameters = new HashMap<String, Object>(); parameters.put("usuario", sUsuario); parameters.put("titulo", Funciones.GetTituloSistemaReporte(this.parametroGeneralSg,this.moduloActual,this.usuarioActual)); parameters.put("subtitulo", "Reporte De Proceso Precios Porcentajes"); parameters.put("busquedapor", ProcesoPreciosPorcentajeConstantesFunciones.getNombreIndice(sAccionBusqueda)+sDetalleReporte); if(this.sTipoReporte.equals("RELACIONES")) {//isEsReporteRelaciones parameters.put("SUBREPORT_DIR", sPathReportes); } parameters.put("con_grafico", this.conGraficoReporte); JasperReport jasperReport = (JasperReport)JRLoader.loadObject(reportFile); this.cargarDatosCliente(); ArrayList<Classe> classes=new ArrayList<Classe>(); if(this.sTipoReporte.equals("RELACIONES")) {//isEsReporteRelaciones } else { //FK DEBERIA TRAERSE DE ANTEMANO } //CLASSES PARA REPORTES OBJETOS RELACIONADOS if(!this.sTipoReporte.equals("RELACIONES")) {//!isEsReporteRelaciones classes=new ArrayList<Classe>(); } JRBeanArrayDataSource jrbeanArrayDataSourceProcesoPreciosPorcentaje=null; if(this.sTipoReporteExtra!=null && !this.sTipoReporteExtra.equals("")) { ProcesoPreciosPorcentajeConstantesFunciones.S_TIPOREPORTE_EXTRA=this.sTipoReporteExtra; } else { ProcesoPreciosPorcentajeConstantesFunciones.S_TIPOREPORTE_EXTRA=""; } jrbeanArrayDataSourceProcesoPreciosPorcentaje=new JRBeanArrayDataSource(ProcesoPreciosPorcentajeJInternalFrame.TraerProcesoPreciosPorcentajeBeans(procesopreciosporcentajesParaReportes,classes).toArray()); jasperPrint = JasperFillManager.fillReport(jasperReport,parameters,jrbeanArrayDataSourceProcesoPreciosPorcentaje); String sPathDest=Constantes.SUNIDAD_ARCHIVOS+":/"+Constantes.SCONTEXTSERVER+"/"+ProcesoPreciosPorcentajeConstantesFunciones.SCHEMA+"/reportes"; File filePathDest = new File(sPathDest); if(!filePathDest.exists()) { filePathDest.mkdirs(); } String sDestFileName=sPathDest+"/"+ProcesoPreciosPorcentajeConstantesFunciones.CLASSNAME; if(this.sTipoArchivoReporte=="VISUALIZAR") { JasperViewer jasperViewer = new JasperViewer(jasperPrint,false) ; jasperViewer.setVisible(true) ; } else if(this.sTipoArchivoReporte=="HTML"||this.sTipoArchivoReporte=="PDF"||this.sTipoArchivoReporte=="XML") { //JasperFillManager.fillReportToFile(reportFile.getAbsolutePath(),parameters, new JRBeanArrayDataSource(ProcesoPreciosPorcentajeBean.TraerProcesoPreciosPorcentajeBeans(procesopreciosporcentajesParaReportes).toArray())); if(this.sTipoArchivoReporte=="HTML") { sDestFileName+=".html"; JasperExportManager.exportReportToHtmlFile(jasperPrint,sDestFileName); } else if(this.sTipoArchivoReporte=="PDF") { sDestFileName+=".pdf"; JasperExportManager.exportReportToPdfFile(jasperPrint,sDestFileName); } else { sDestFileName+=".xml"; JasperExportManager.exportReportToXmlFile(jasperPrint,sDestFileName, false); } } else if(this.sTipoArchivoReporte=="WORD"||this.sTipoArchivoReporte=="EXCEL") { if(this.sTipoArchivoReporte=="WORD") { sDestFileName+=".rtf"; JRRtfExporter exporter = new JRRtfExporter(); exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint); exporter.setParameter(JRExporterParameter.OUTPUT_FILE_NAME, sDestFileName); exporter.exportReport(); } else { sDestFileName+=".xls"; JRXlsExporter exporterXls = new JRXlsExporter(); exporterXls.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint); exporterXls.setParameter(JRExporterParameter.OUTPUT_FILE_NAME, sDestFileName); exporterXls.setParameter(JRXlsExporterParameter.IS_ONE_PAGE_PER_SHEET, Boolean.TRUE); exporterXls.exportReport(); } } else if(this.sTipoArchivoReporte=="EXCEL2"||this.sTipoArchivoReporte=="EXCEL2_2") { //sDestFileName+=".xlsx"; if(this.sTipoReporte.equals("NORMAL")) { this.generarExcelReporteProcesoPreciosPorcentajes(sAccionBusqueda,sTipoArchivoReporte,procesopreciosporcentajesParaReportes); } else if(this.sTipoReporte.equals("FORMULARIO")){ this.generarExcelReporteVerticalProcesoPreciosPorcentajes(sAccionBusqueda,sTipoArchivoReporte,procesopreciosporcentajesParaReportes,false); } else if(this.sTipoReporte.equals("DINAMICO")){ if(this.sTipoReporteDinamico.equals("NORMAL")) { this.jButtonGenerarExcelReporteDinamicoProcesoPreciosPorcentajeActionPerformed(null); //this.generarExcelReporteProcesoPreciosPorcentajes(sAccionBusqueda,sTipoArchivoReporte,procesopreciosporcentajesParaReportes); } else if(this.sTipoReporteDinamico.equals("FORMULARIO")){ this.generarExcelReporteVerticalProcesoPreciosPorcentajes(sAccionBusqueda,sTipoArchivoReporte,procesopreciosporcentajesParaReportes,true); } else if(this.sTipoReporteDinamico.equals("RELACIONES")){ this.generarExcelReporteRelacionesProcesoPreciosPorcentajes(sAccionBusqueda,sTipoArchivoReporte,procesopreciosporcentajesParaReportes,true); } } else if(this.sTipoReporte.equals("RELACIONES")){ this.generarExcelReporteRelacionesProcesoPreciosPorcentajes(sAccionBusqueda,sTipoArchivoReporte,procesopreciosporcentajesParaReportes,false); } } if(this.sTipoArchivoReporte=="HTML"||this.sTipoArchivoReporte=="PDF"||this.sTipoArchivoReporte=="XML"||this.sTipoArchivoReporte=="WORD"||this.sTipoArchivoReporte=="EXCEL") { JOptionPane.showMessageDialog(this,"REPORTE "+sDestFileName+" GENERADO SATISFACTORIAMENTE","REPORTES ",JOptionPane.INFORMATION_MESSAGE); } } public void generarExcelReporteProcesoPreciosPorcentajes(String sAccionBusqueda,String sTipoArchivoReporte,List<ProcesoPreciosPorcentaje> procesopreciosporcentajesParaReportes) throws Exception { Workbook workbook = null; String sPath=this.parametroGeneralUsuario.getpath_exportar()+"procesopreciosporcentaje"; if(sTipoArchivoReporte=="EXCEL2") { workbook = new HSSFWorkbook(); sPath+=".xls"; } else if(sTipoArchivoReporte=="EXCEL2_2") { workbook = new XSSFWorkbook(); sPath+=".xlsx"; } Sheet sheet = workbook.createSheet("ProcesoPreciosPorcentajes"); int iRow = 0; int iCell = 0; Row row =null; Cell cell=null; row = sheet.createRow(iRow++); this.generarExcelReporteHeaderProcesoPreciosPorcentaje("NORMAL",row,workbook); CellStyle cellStyleData = Funciones2.getStyleTitulo(workbook,"ZEBRA"); CellStyle cellStyleDataAux=null; int i=0; for(ProcesoPreciosPorcentaje procesopreciosporcentaje : procesopreciosporcentajesParaReportes) { row = sheet.createRow(iRow++); iCell = 0; cellStyleDataAux=null; if(i%2==0) { cellStyleDataAux=cellStyleData; } ProcesoPreciosPorcentajeConstantesFunciones.generarExcelReporteDataProcesoPreciosPorcentaje("NORMAL",row,workbook,procesopreciosporcentaje,cellStyleDataAux); /* Cell cell0 = row.createCell(0); cell0.setCellValue(country.getName()); Cell cell1 = row.createCell(1); cell1.setCellValue(country.getShortCode()); */ i++; } FileOutputStream fileOutputStream = new FileOutputStream(sPath); workbook.write(fileOutputStream); fileOutputStream.close(); Constantes2.S_PATH_ULTIMO_ARCHIVO=sPath; if(this.parametroGeneralUsuario.getcon_mensaje_confirmacion() && !this.procesopreciosporcentajeSessionBean.getEsGuardarRelacionado()) {//Constantes.ISMOSTRARMENSAJESMANTENIMIENTO && JOptionPane.showMessageDialog(this,"EXPORTADO CORRECTAMENTE:"+sPath,"MANTENIMIENTO DE Proceso Precios Porcentaje",JOptionPane.INFORMATION_MESSAGE); } } public void generarExcelReporteHeaderProcesoPreciosPorcentaje(String sTipo,Row row,Workbook workbook) { ProcesoPreciosPorcentajeConstantesFunciones.generarExcelReporteHeaderProcesoPreciosPorcentaje(sTipo,row,workbook); /* Cell cell=null; int iCell=0; CellStyle cellStyle = workbook.createCellStyle(); cellStyle.setFillBackgroundColor(IndexedColors.GREEN.getIndex()); cellStyle.setFillPattern(CellStyle.ALIGN_FILL); */ } public void generarExcelReporteVerticalProcesoPreciosPorcentajes(String sAccionBusqueda,String sTipoArchivoReporte,List<ProcesoPreciosPorcentaje> procesopreciosporcentajesParaReportes,Boolean paraDinamico) throws Exception { Workbook workbook = null; String sPath=this.parametroGeneralUsuario.getpath_exportar()+"procesopreciosporcentaje_vertical"; if(sTipoArchivoReporte=="EXCEL2") { workbook = new HSSFWorkbook(); sPath+=".xls"; } else if(sTipoArchivoReporte=="EXCEL2_2") { workbook = new XSSFWorkbook(); sPath+=".xlsx"; } Sheet sheet = workbook.createSheet("ProcesoPreciosPorcentajes"); int iRow = 0; int iRowLast = 0; int iCell = 0; Row row =null; Cell cell=null; row = sheet.createRow(iRow++); CellStyle cellStyle = Funciones2.getStyleTitulo(workbook,"ZEBRA");; CellStyle cellStyleTitulo = Funciones2.getStyleTitulo(workbook,"PRINCIPAL_VERTICAL"); for(ProcesoPreciosPorcentaje procesopreciosporcentaje : procesopreciosporcentajesParaReportes) { row = sheet.createRow(iRow++); iRowLast=iRow - 1; cell = row.createCell(0); cell.setCellValue(ProcesoPreciosPorcentajeConstantesFunciones.getProcesoPreciosPorcentajeDescripcion(procesopreciosporcentaje)); cell.setCellStyle(cellStyleTitulo); sheet.addMergedRegion(new CellRangeAddress(iRowLast,iRowLast,0,2)); if(!paraDinamico || (paraDinamico && this.existeColumnaReporteDinamico(ProcesoPreciosPorcentajeConstantesFunciones.LABEL_IDBODEGA))) { row = sheet.createRow(iRow++); cell = row.createCell(0); cell.setCellValue(ProcesoPreciosPorcentajeConstantesFunciones.LABEL_IDBODEGA); cell.setCellStyle(cellStyle); cell = row.createCell(1); cell.setCellValue(procesopreciosporcentaje.getbodega_descripcion()); } if(!paraDinamico || (paraDinamico && this.existeColumnaReporteDinamico(ProcesoPreciosPorcentajeConstantesFunciones.LABEL_IDPRODUCTO))) { row = sheet.createRow(iRow++); cell = row.createCell(0); cell.setCellValue(ProcesoPreciosPorcentajeConstantesFunciones.LABEL_IDPRODUCTO); cell.setCellStyle(cellStyle); cell = row.createCell(1); cell.setCellValue(procesopreciosporcentaje.getproducto_descripcion()); } if(!paraDinamico || (paraDinamico && this.existeColumnaReporteDinamico(ProcesoPreciosPorcentajeConstantesFunciones.LABEL_IDEMPRESA))) { row = sheet.createRow(iRow++); cell = row.createCell(0); cell.setCellValue(ProcesoPreciosPorcentajeConstantesFunciones.LABEL_IDEMPRESA); cell.setCellStyle(cellStyle); cell = row.createCell(1); cell.setCellValue(procesopreciosporcentaje.getempresa_descripcion()); } if(!paraDinamico || (paraDinamico && this.existeColumnaReporteDinamico(ProcesoPreciosPorcentajeConstantesFunciones.LABEL_IDSUCURSAL))) { row = sheet.createRow(iRow++); cell = row.createCell(0); cell.setCellValue(ProcesoPreciosPorcentajeConstantesFunciones.LABEL_IDSUCURSAL); cell.setCellStyle(cellStyle); cell = row.createCell(1); cell.setCellValue(procesopreciosporcentaje.getsucursal_descripcion()); } if(!paraDinamico || (paraDinamico && this.existeColumnaReporteDinamico(ProcesoPreciosPorcentajeConstantesFunciones.LABEL_IDLINEA))) { row = sheet.createRow(iRow++); cell = row.createCell(0); cell.setCellValue(ProcesoPreciosPorcentajeConstantesFunciones.LABEL_IDLINEA); cell.setCellStyle(cellStyle); cell = row.createCell(1); cell.setCellValue(procesopreciosporcentaje.getlinea_descripcion()); } if(!paraDinamico || (paraDinamico && this.existeColumnaReporteDinamico(ProcesoPreciosPorcentajeConstantesFunciones.LABEL_IDLINEAGRUPO))) { row = sheet.createRow(iRow++); cell = row.createCell(0); cell.setCellValue(ProcesoPreciosPorcentajeConstantesFunciones.LABEL_IDLINEAGRUPO); cell.setCellStyle(cellStyle); cell = row.createCell(1); cell.setCellValue(procesopreciosporcentaje.getlineagrupo_descripcion()); } if(!paraDinamico || (paraDinamico && this.existeColumnaReporteDinamico(ProcesoPreciosPorcentajeConstantesFunciones.LABEL_IDLINEACATEGORIA))) { row = sheet.createRow(iRow++); cell = row.createCell(0); cell.setCellValue(ProcesoPreciosPorcentajeConstantesFunciones.LABEL_IDLINEACATEGORIA); cell.setCellStyle(cellStyle); cell = row.createCell(1); cell.setCellValue(procesopreciosporcentaje.getlineacategoria_descripcion()); } if(!paraDinamico || (paraDinamico && this.existeColumnaReporteDinamico(ProcesoPreciosPorcentajeConstantesFunciones.LABEL_IDLINEAMARCA))) { row = sheet.createRow(iRow++); cell = row.createCell(0); cell.setCellValue(ProcesoPreciosPorcentajeConstantesFunciones.LABEL_IDLINEAMARCA); cell.setCellStyle(cellStyle); cell = row.createCell(1); cell.setCellValue(procesopreciosporcentaje.getlineamarca_descripcion()); } if(!paraDinamico || (paraDinamico && this.existeColumnaReporteDinamico(ProcesoPreciosPorcentajeConstantesFunciones.LABEL_CODIGO))) { row = sheet.createRow(iRow++); cell = row.createCell(0); cell.setCellValue(ProcesoPreciosPorcentajeConstantesFunciones.LABEL_CODIGO); cell.setCellStyle(cellStyle); cell = row.createCell(1); cell.setCellValue(procesopreciosporcentaje.getcodigo()); } if(!paraDinamico || (paraDinamico && this.existeColumnaReporteDinamico(ProcesoPreciosPorcentajeConstantesFunciones.LABEL_NOMBRE))) { row = sheet.createRow(iRow++); cell = row.createCell(0); cell.setCellValue(ProcesoPreciosPorcentajeConstantesFunciones.LABEL_NOMBRE); cell.setCellStyle(cellStyle); cell = row.createCell(1); cell.setCellValue(procesopreciosporcentaje.getnombre()); } if(!paraDinamico || (paraDinamico && this.existeColumnaReporteDinamico(ProcesoPreciosPorcentajeConstantesFunciones.LABEL_CODIGOPRODUCTO))) { row = sheet.createRow(iRow++); cell = row.createCell(0); cell.setCellValue(ProcesoPreciosPorcentajeConstantesFunciones.LABEL_CODIGOPRODUCTO); cell.setCellStyle(cellStyle); cell = row.createCell(1); cell.setCellValue(procesopreciosporcentaje.getcodigo_producto()); } if(!paraDinamico || (paraDinamico && this.existeColumnaReporteDinamico(ProcesoPreciosPorcentajeConstantesFunciones.LABEL_NOMBREPRODUCTO))) { row = sheet.createRow(iRow++); cell = row.createCell(0); cell.setCellValue(ProcesoPreciosPorcentajeConstantesFunciones.LABEL_NOMBREPRODUCTO); cell.setCellStyle(cellStyle); cell = row.createCell(1); cell.setCellValue(procesopreciosporcentaje.getnombre_producto()); } if(!paraDinamico || (paraDinamico && this.existeColumnaReporteDinamico(ProcesoPreciosPorcentajeConstantesFunciones.LABEL_PRECIO))) { row = sheet.createRow(iRow++); cell = row.createCell(0); cell.setCellValue(ProcesoPreciosPorcentajeConstantesFunciones.LABEL_PRECIO); cell.setCellStyle(cellStyle); cell = row.createCell(1); cell.setCellValue(procesopreciosporcentaje.getprecio()); } if(!paraDinamico || (paraDinamico && this.existeColumnaReporteDinamico(ProcesoPreciosPorcentajeConstantesFunciones.LABEL_PORCENTAJE))) { row = sheet.createRow(iRow++); cell = row.createCell(0); cell.setCellValue(ProcesoPreciosPorcentajeConstantesFunciones.LABEL_PORCENTAJE); cell.setCellStyle(cellStyle); cell = row.createCell(1); cell.setCellValue(procesopreciosporcentaje.getporcentaje()); } } FileOutputStream fileOutputStream = new FileOutputStream(sPath); workbook.write(fileOutputStream); fileOutputStream.close(); Constantes2.S_PATH_ULTIMO_ARCHIVO=sPath; if(this.parametroGeneralUsuario.getcon_mensaje_confirmacion() && !this.procesopreciosporcentajeSessionBean.getEsGuardarRelacionado()) {//Constantes.ISMOSTRARMENSAJESMANTENIMIENTO && JOptionPane.showMessageDialog(this,"EXPORTADO CORRECTAMENTE:"+sPath,"MANTENIMIENTO DE Proceso Precios Porcentaje",JOptionPane.INFORMATION_MESSAGE); } } public void generarExcelReporteRelacionesProcesoPreciosPorcentajes(String sAccionBusqueda,String sTipoArchivoReporte,List<ProcesoPreciosPorcentaje> procesopreciosporcentajesParaReportes,Boolean paraDinamico) throws Exception { ArrayList<Classe> classes=new ArrayList<Classe>(); List<ProcesoPreciosPorcentaje> procesopreciosporcentajesRespaldo=null; classes=ProcesoPreciosPorcentajeConstantesFunciones.getClassesRelationshipsOfProcesoPreciosPorcentaje(new ArrayList<Classe>(),DeepLoadType.NONE,false); this.datosDeep=new DatosDeep(); this.datosDeep.setIsDeep(false); this.datosDeep.setDeepLoadType(DeepLoadType.INCLUDE); this.datosDeep.setClases(classes); this.datosCliente.setDatosDeepParametros(false, DeepLoadType.INCLUDE, classes, ""); this.datosCliente.setIsConDeep(true); this.datosCliente.setIsConExportar(false); this.procesopreciosporcentajeLogic.setDatosCliente(this.datosCliente); this.procesopreciosporcentajeLogic.setDatosDeep(this.datosDeep); this.procesopreciosporcentajeLogic.setIsConDeep(true); procesopreciosporcentajesRespaldo=this.procesopreciosporcentajeLogic.getProcesoPreciosPorcentajes(); this.procesopreciosporcentajeLogic.setProcesoPreciosPorcentajes(procesopreciosporcentajesParaReportes); this.procesopreciosporcentajeLogic.deepLoadsWithConnection(false, DeepLoadType.INCLUDE, classes,""); procesopreciosporcentajesParaReportes=this.procesopreciosporcentajeLogic.getProcesoPreciosPorcentajes(); this.procesopreciosporcentajeLogic.setProcesoPreciosPorcentajes(procesopreciosporcentajesRespaldo); Workbook workbook = null; String sPath=this.parametroGeneralUsuario.getpath_exportar()+"procesopreciosporcentaje_relacion"; if(sTipoArchivoReporte=="EXCEL2") { workbook = new HSSFWorkbook(); sPath+=".xls"; } else if(sTipoArchivoReporte=="EXCEL2_2") { workbook = new XSSFWorkbook(); sPath+=".xlsx"; } Sheet sheet = workbook.createSheet("ProcesoPreciosPorcentajes"); int iRow = 0; int iRowLast = 0; int iCell = 0; Row row =null; Cell cell=null; row = sheet.createRow(iRow++); this.generarExcelReporteHeaderProcesoPreciosPorcentaje("NORMAL",row,workbook); int i=0; int i2=0; CellStyle cellStyleData = Funciones2.getStyleTitulo(workbook,"ZEBRA"); CellStyle cellStyleDataTitulo = Funciones2.getStyleTitulo(workbook,"PRINCIPAL"); CellStyle cellStyleDataZebra = Funciones2.getStyleTitulo(workbook,"ZEBRA"); CellStyle cellStyleDataAux =null; CellStyle cellStyleDataAuxHijo =null; for(ProcesoPreciosPorcentaje procesopreciosporcentaje : procesopreciosporcentajesParaReportes) { if(i!=0) { row = sheet.createRow(iRow++); this.generarExcelReporteHeaderProcesoPreciosPorcentaje("NORMAL",row,workbook); } cellStyleDataAux=null; if(i%2==0) { //cellStyleDataAux=cellStyleData; } row = sheet.createRow(iRow++); ProcesoPreciosPorcentajeConstantesFunciones.generarExcelReporteDataProcesoPreciosPorcentaje("NORMAL",row,workbook,procesopreciosporcentaje,cellStyleDataAux); i++; } /* row = sheet.createRow(iRow++); iRowLast=iRow - 1; cell = row.createCell(0); cell.setCellValue(ProcesoPreciosPorcentajeConstantesFunciones.getProcesoPreciosPorcentajeDescripcion(procesopreciosporcentaje)); cell.setCellStyle(cellStyleTitulo); sheet.addMergedRegion(new CellRangeAddress(iRowLast,iRowLast,0,2)); */ FileOutputStream fileOutputStream = new FileOutputStream(sPath); workbook.write(fileOutputStream); fileOutputStream.close(); Constantes2.S_PATH_ULTIMO_ARCHIVO=sPath; if(this.parametroGeneralUsuario.getcon_mensaje_confirmacion() && !this.procesopreciosporcentajeSessionBean.getEsGuardarRelacionado()) {//Constantes.ISMOSTRARMENSAJESMANTENIMIENTO && JOptionPane.showMessageDialog(this,"EXPORTADO CORRECTAMENTE:"+sPath,"MANTENIMIENTO DE Proceso Precios Porcentaje",JOptionPane.INFORMATION_MESSAGE); } } public Boolean existeColumnaReporteDinamico(String sColumna) { Boolean existe=false; Reporte reporte=new Reporte(); for(int index:this.jInternalFrameReporteDinamicoProcesoPreciosPorcentaje.getjListColumnasSelectReporte().getSelectedIndices()) { reporte=(Reporte)this.jInternalFrameReporteDinamicoProcesoPreciosPorcentaje.getjListColumnasSelectReporte().getModel().getElementAt(index); if(sColumna.equals(reporte.getsCodigo())) { existe=true; break; } } return existe; } public Boolean existeRelacionReporteDinamico(String sColumna) { Boolean existe=false; Reporte reporte=new Reporte(); for(int index:this.jInternalFrameReporteDinamicoProcesoPreciosPorcentaje.getjListRelacionesSelectReporte().getSelectedIndices()) { reporte=(Reporte)this.jInternalFrameReporteDinamicoProcesoPreciosPorcentaje.getjListRelacionesSelectReporte().getModel().getElementAt(index); if(sColumna.equals(reporte.getsCodigo())) { existe=true; break; } } return existe; } public void startProcessProcesoPreciosPorcentaje() throws Exception { this.startProcessProcesoPreciosPorcentaje(true); } public void startProcessProcesoPreciosPorcentaje(Boolean conSplash) throws Exception { //FuncionesSwing.enableDisablePanels(false,this.jTabbedPaneBusquedasProcesoPreciosPorcentaje ,this.jPanelParametrosReportesProcesoPreciosPorcentaje, this.jScrollPanelDatosProcesoPreciosPorcentaje,this.jPanelPaginacionProcesoPreciosPorcentaje, this.jScrollPanelDatosEdicionProcesoPreciosPorcentaje, this.jPanelAccionesProcesoPreciosPorcentaje,this.jPanelAccionesFormularioProcesoPreciosPorcentaje,this.jmenuBarProcesoPreciosPorcentaje,this.jmenuBarDetalleProcesoPreciosPorcentaje,this.jTtoolBarProcesoPreciosPorcentaje,this.jTtoolBarDetalleProcesoPreciosPorcentaje); final JTabbedPane jTabbedPaneBusquedasProcesoPreciosPorcentaje=this.jTabbedPaneBusquedasProcesoPreciosPorcentaje; final JPanel jPanelParametrosReportesProcesoPreciosPorcentaje=this.jPanelParametrosReportesProcesoPreciosPorcentaje; //final JScrollPane jScrollPanelDatosProcesoPreciosPorcentaje=this.jScrollPanelDatosProcesoPreciosPorcentaje; final JTable jTableDatosProcesoPreciosPorcentaje=this.jTableDatosProcesoPreciosPorcentaje; final JPanel jPanelPaginacionProcesoPreciosPorcentaje=this.jPanelPaginacionProcesoPreciosPorcentaje; //final JScrollPane jScrollPanelDatosEdicionProcesoPreciosPorcentaje=this.jScrollPanelDatosEdicionProcesoPreciosPorcentaje; final JPanel jPanelAccionesProcesoPreciosPorcentaje=this.jPanelAccionesProcesoPreciosPorcentaje; JPanel jPanelCamposAuxiliarProcesoPreciosPorcentaje=new JPanelMe(); JPanel jPanelAccionesFormularioAuxiliarProcesoPreciosPorcentaje=new JPanelMe(); if(this.jInternalFrameDetalleFormProcesoPreciosPorcentaje!=null) { jPanelCamposAuxiliarProcesoPreciosPorcentaje=this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jPanelCamposProcesoPreciosPorcentaje; jPanelAccionesFormularioAuxiliarProcesoPreciosPorcentaje=this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jPanelAccionesFormularioProcesoPreciosPorcentaje; } final JPanel jPanelCamposProcesoPreciosPorcentaje=jPanelCamposAuxiliarProcesoPreciosPorcentaje; final JPanel jPanelAccionesFormularioProcesoPreciosPorcentaje=jPanelAccionesFormularioAuxiliarProcesoPreciosPorcentaje; final JMenuBar jmenuBarProcesoPreciosPorcentaje=this.jmenuBarProcesoPreciosPorcentaje; final JToolBar jTtoolBarProcesoPreciosPorcentaje=this.jTtoolBarProcesoPreciosPorcentaje; JMenuBar jmenuBarDetalleAuxiliarProcesoPreciosPorcentaje=new JMenuBar(); JToolBar jTtoolBarDetalleAuxiliarProcesoPreciosPorcentaje=new JToolBar(); if(this.jInternalFrameDetalleFormProcesoPreciosPorcentaje!=null) { jmenuBarDetalleAuxiliarProcesoPreciosPorcentaje=this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jmenuBarDetalleProcesoPreciosPorcentaje; jTtoolBarDetalleAuxiliarProcesoPreciosPorcentaje=this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jTtoolBarDetalleProcesoPreciosPorcentaje; } final JMenuBar jmenuBarDetalleProcesoPreciosPorcentaje=jmenuBarDetalleAuxiliarProcesoPreciosPorcentaje; final JToolBar jTtoolBarDetalleProcesoPreciosPorcentaje=jTtoolBarDetalleAuxiliarProcesoPreciosPorcentaje; if(Constantes2.CON_PROCESO_HILO) { Thread threadRunnableProcess; ProcessRunnable processRunnable; processRunnable=new ProcessRunnable(); processRunnable.setsTipo("START"); processRunnable.setDesktop(jDesktopPane); processRunnable.setModuloActual(moduloActual); processRunnable.setModuloUsuarioSeleccionado(moduloActual); processRunnable.setOpcionActual(opcionActual); processRunnable.setParametroGeneralSg(parametroGeneralSg); processRunnable.setParametroGeneralUsuario(parametroGeneralUsuario); processRunnable.setResumenUsuarioActual(resumenUsuarioActual); processRunnable.setUsuarioActual(usuarioActual); processRunnable.jTabbedPaneBusquedas=jTabbedPaneBusquedasProcesoPreciosPorcentaje; processRunnable.jPanelParametrosReportes=jPanelParametrosReportesProcesoPreciosPorcentaje; processRunnable.jTableDatos=jTableDatosProcesoPreciosPorcentaje; processRunnable.jPanelCampos=jPanelCamposProcesoPreciosPorcentaje; processRunnable.jPanelPaginacion=jPanelPaginacionProcesoPreciosPorcentaje; processRunnable.jPanelAcciones=jPanelAccionesProcesoPreciosPorcentaje; processRunnable.jPanelAccionesFormulario=jPanelAccionesFormularioProcesoPreciosPorcentaje; processRunnable.jmenuBar=jmenuBarProcesoPreciosPorcentaje; processRunnable.jmenuBarDetalle=jmenuBarDetalleProcesoPreciosPorcentaje; processRunnable.jTtoolBar=jTtoolBarProcesoPreciosPorcentaje; processRunnable.jTtoolBarDetalle=jTtoolBarDetalleProcesoPreciosPorcentaje; processRunnable.jInternalFrameBase=this; //processRunnable.CargarObjetosRendimientoCriticoModuloInventario(); threadRunnableProcess=new Thread(processRunnable);//.start(); threadRunnableProcess.start(); } else { FuncionesSwing.enableDisablePanels(false,jTabbedPaneBusquedasProcesoPreciosPorcentaje ,jPanelParametrosReportesProcesoPreciosPorcentaje,jTableDatosProcesoPreciosPorcentaje, /*jScrollPanelDatosProcesoPreciosPorcentaje,*/jPanelCamposProcesoPreciosPorcentaje,jPanelPaginacionProcesoPreciosPorcentaje, /*jScrollPanelDatosEdicionProcesoPreciosPorcentaje,*/ jPanelAccionesProcesoPreciosPorcentaje,jPanelAccionesFormularioProcesoPreciosPorcentaje,jmenuBarProcesoPreciosPorcentaje,jmenuBarDetalleProcesoPreciosPorcentaje,jTtoolBarProcesoPreciosPorcentaje,jTtoolBarDetalleProcesoPreciosPorcentaje); startProcess();//this. } /* if(conSplash) { SwingUtilities.invokeLater(new Runnable() { public void run() { try { FuncionesSwing.enableDisablePanels(false,jTabbedPaneBusquedasProcesoPreciosPorcentaje ,jPanelParametrosReportesProcesoPreciosPorcentaje, jScrollPanelDatosProcesoPreciosPorcentaje,jPanelPaginacionProcesoPreciosPorcentaje, jScrollPanelDatosEdicionProcesoPreciosPorcentaje, jPanelAccionesProcesoPreciosPorcentaje,jPanelAccionesFormularioProcesoPreciosPorcentaje,jmenuBarProcesoPreciosPorcentaje,jmenuBarDetalleProcesoPreciosPorcentaje,jTtoolBarProcesoPreciosPorcentaje,jTtoolBarDetalleProcesoPreciosPorcentaje); startProcess();//this. } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } } }); } */ } public void finishProcessProcesoPreciosPorcentaje() {// throws Exception this.finishProcessProcesoPreciosPorcentaje(true); } public void finishProcessProcesoPreciosPorcentaje(Boolean conSplash) {// throws Exception //FuncionesSwing.enableDisablePanels(true,this.jTabbedPaneBusquedasProcesoPreciosPorcentaje ,this.jPanelParametrosReportesProcesoPreciosPorcentaje, this.jScrollPanelDatosProcesoPreciosPorcentaje,this.jPanelPaginacionProcesoPreciosPorcentaje, this.jScrollPanelDatosEdicionProcesoPreciosPorcentaje, this.jPanelAccionesProcesoPreciosPorcentaje,this.jPanelAccionesFormularioProcesoPreciosPorcentaje,this.jmenuBarProcesoPreciosPorcentaje,this.jmenuBarDetalleProcesoPreciosPorcentaje,this.jTtoolBarProcesoPreciosPorcentaje,this.jTtoolBarDetalleProcesoPreciosPorcentaje); final JTabbedPane jTabbedPaneBusquedasProcesoPreciosPorcentaje=this.jTabbedPaneBusquedasProcesoPreciosPorcentaje; final JPanel jPanelParametrosReportesProcesoPreciosPorcentaje=this.jPanelParametrosReportesProcesoPreciosPorcentaje; //final JScrollPane jScrollPanelDatosProcesoPreciosPorcentaje=this.jScrollPanelDatosProcesoPreciosPorcentaje; final JTable jTableDatosProcesoPreciosPorcentaje=this.jTableDatosProcesoPreciosPorcentaje; final JPanel jPanelPaginacionProcesoPreciosPorcentaje=this.jPanelPaginacionProcesoPreciosPorcentaje; //final JScrollPane jScrollPanelDatosEdicionProcesoPreciosPorcentaje=this.jScrollPanelDatosEdicionProcesoPreciosPorcentaje; final JPanel jPanelAccionesProcesoPreciosPorcentaje=this.jPanelAccionesProcesoPreciosPorcentaje; JPanel jPanelCamposAuxiliarProcesoPreciosPorcentaje=new JPanel(); JPanel jPanelAccionesFormularioAuxiliarProcesoPreciosPorcentaje=new JPanel(); if(this.jInternalFrameDetalleFormProcesoPreciosPorcentaje!=null) { jPanelCamposAuxiliarProcesoPreciosPorcentaje=this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jPanelCamposProcesoPreciosPorcentaje; jPanelAccionesFormularioAuxiliarProcesoPreciosPorcentaje=this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jPanelAccionesFormularioProcesoPreciosPorcentaje; } final JPanel jPanelCamposProcesoPreciosPorcentaje=jPanelCamposAuxiliarProcesoPreciosPorcentaje; final JPanel jPanelAccionesFormularioProcesoPreciosPorcentaje=jPanelAccionesFormularioAuxiliarProcesoPreciosPorcentaje; final JMenuBar jmenuBarProcesoPreciosPorcentaje=this.jmenuBarProcesoPreciosPorcentaje; final JToolBar jTtoolBarProcesoPreciosPorcentaje=this.jTtoolBarProcesoPreciosPorcentaje; JMenuBar jmenuBarDetalleAuxiliarProcesoPreciosPorcentaje=new JMenuBar(); JToolBar jTtoolBarDetalleAuxiliarProcesoPreciosPorcentaje=new JToolBar(); if(this.jInternalFrameDetalleFormProcesoPreciosPorcentaje!=null) { jmenuBarDetalleAuxiliarProcesoPreciosPorcentaje=this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jmenuBarDetalleProcesoPreciosPorcentaje; jTtoolBarDetalleAuxiliarProcesoPreciosPorcentaje=this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jTtoolBarDetalleProcesoPreciosPorcentaje; } final JMenuBar jmenuBarDetalleProcesoPreciosPorcentaje=jmenuBarDetalleAuxiliarProcesoPreciosPorcentaje; final JToolBar jTtoolBarDetalleProcesoPreciosPorcentaje=jTtoolBarDetalleAuxiliarProcesoPreciosPorcentaje; if(Constantes2.CON_PROCESO_HILO) { Thread threadRunnableProcess; ProcessRunnable processRunnable; processRunnable=new ProcessRunnable(); processRunnable.setsTipo("END"); processRunnable.setDesktop(jDesktopPane); processRunnable.setModuloActual(moduloActual); processRunnable.setModuloUsuarioSeleccionado(moduloActual); processRunnable.setOpcionActual(opcionActual); processRunnable.setParametroGeneralSg(parametroGeneralSg); processRunnable.setParametroGeneralUsuario(parametroGeneralUsuario); processRunnable.setResumenUsuarioActual(resumenUsuarioActual); processRunnable.setUsuarioActual(usuarioActual); processRunnable.jTabbedPaneBusquedas=jTabbedPaneBusquedasProcesoPreciosPorcentaje; processRunnable.jPanelParametrosReportes=jPanelParametrosReportesProcesoPreciosPorcentaje; processRunnable.jTableDatos=jTableDatosProcesoPreciosPorcentaje; processRunnable.jPanelCampos=jPanelCamposProcesoPreciosPorcentaje; processRunnable.jPanelPaginacion=jPanelPaginacionProcesoPreciosPorcentaje; processRunnable.jPanelAcciones=jPanelAccionesProcesoPreciosPorcentaje; processRunnable.jPanelAccionesFormulario=jPanelAccionesFormularioProcesoPreciosPorcentaje; processRunnable.jmenuBar=jmenuBarProcesoPreciosPorcentaje; processRunnable.jmenuBarDetalle=jmenuBarDetalleProcesoPreciosPorcentaje; processRunnable.jTtoolBar=jTtoolBarProcesoPreciosPorcentaje; processRunnable.jTtoolBarDetalle=jTtoolBarDetalleProcesoPreciosPorcentaje; processRunnable.jInternalFrameBase=this; //processRunnable.CargarObjetosRendimientoCriticoModuloInventario(); threadRunnableProcess=new Thread(processRunnable);//.start(); threadRunnableProcess.start(); } else { if(conSplash) { SwingUtilities.invokeLater(new RunnableProceso(true,this,jTabbedPaneBusquedasProcesoPreciosPorcentaje ,jPanelParametrosReportesProcesoPreciosPorcentaje, jTableDatosProcesoPreciosPorcentaje,/*jScrollPanelDatosProcesoPreciosPorcentaje,*/jPanelCamposProcesoPreciosPorcentaje,jPanelPaginacionProcesoPreciosPorcentaje, /*jScrollPanelDatosEdicionProcesoPreciosPorcentaje,*/ jPanelAccionesProcesoPreciosPorcentaje,jPanelAccionesFormularioProcesoPreciosPorcentaje,jmenuBarProcesoPreciosPorcentaje,jmenuBarDetalleProcesoPreciosPorcentaje,jTtoolBarProcesoPreciosPorcentaje,jTtoolBarDetalleProcesoPreciosPorcentaje)); } } } /* public void habilitarDeshabilitarControlesProcesoPreciosPorcentaje(Boolean esHabilitar,Boolean conDetalle) { this.habilitarDeshabilitarToolBarProcesoPreciosPorcentaje(esHabilitar,conDetalle); this.habilitarDeshabilitarMenuProcesoPreciosPorcentaje(esHabilitar,conDetalle); } public void habilitarDeshabilitarToolBarProcesoPreciosPorcentaje(Boolean esHabilitar,Boolean conDetalle) { FuncionesSwing.enableDisableComponents(this.jTtoolBarProcesoPreciosPorcentaje,esHabilitar,1,1); if(conDetalle) { FuncionesSwing.enableDisableComponents(this.jTtoolBarDetalleProcesoPreciosPorcentaje,esHabilitar,1,1); } } public void habilitarDeshabilitarMenuProcesoPreciosPorcentaje(Boolean esHabilitar,Boolean conDetalle) { FuncionesSwing.enableDisableComponents(this.jmenuBarProcesoPreciosPorcentaje,esHabilitar,1,1); if(conDetalle) { FuncionesSwing.enableDisableComponents(this.jmenuBarDetalleProcesoPreciosPorcentaje,esHabilitar,1,1); } } */ public void procesarBusqueda(String sAccionBusqueda) throws Exception { String finalQueryPaginacion=this.procesopreciosporcentajeConstantesFunciones.getsFinalQueryProcesoPreciosPorcentaje(); String finalQueryPaginacionTodos=this.procesopreciosporcentajeConstantesFunciones.getsFinalQueryProcesoPreciosPorcentaje(); Boolean esBusqueda=false; this.actualizarVariablesTipoReporte(true,false,false,""); /* this.sTipoReporteExtra=""; this.esReporteDinamico=false; this.sPathReporteDinamico=""; */ if(!sAccionBusqueda.equals("Todos")) { esBusqueda=true; } this.arrDatoGeneral= new ArrayList<DatoGeneral>(); this.arrDatoGeneralNo= new ArrayList<String>(); ArrayList<String> arrColumnasGlobalesNo=ProcesoPreciosPorcentajeConstantesFunciones.getArrayColumnasGlobalesNoProcesoPreciosPorcentaje(this.arrDatoGeneral); ArrayList<String> arrColumnasGlobales=ProcesoPreciosPorcentajeConstantesFunciones.getArrayColumnasGlobalesProcesoPreciosPorcentaje(this.arrDatoGeneral,arrColumnasGlobalesNo); String finalQueryGlobal=""; finalQueryGlobal=Funciones.GetWhereGlobalConstants(this.parametroGeneralUsuario,this.moduloActual,!esBusqueda,esBusqueda,arrColumnasGlobales,ProcesoPreciosPorcentajeConstantesFunciones.TABLENAME); String sOrderBy=""; sOrderBy=Funciones2.getFinalQueryOrderBy(this.arrOrderBy); if(!sOrderBy.equals("")) { finalQueryPaginacion=sOrderBy; finalQueryPaginacionTodos=sOrderBy; } //INICIALIZA ELIMINADOS this.procesopreciosporcentajesEliminados= new ArrayList<ProcesoPreciosPorcentaje>(); if(!this.isEntroOnLoad) { this.onLoad(); }/* else { this.isEntroOnLoad=false; }*/ try { //this.startProcessProcesoPreciosPorcentaje(); ///*ProcesoPreciosPorcentajeSessionBean*/this.procesopreciosporcentajeSessionBean=new ProcesoPreciosPorcentajeSessionBean(); if(this.procesopreciosporcentajeSessionBean==null) { this.procesopreciosporcentajeSessionBean=new ProcesoPreciosPorcentajeSessionBean(); } //ACTUALIZA EL TAMANIO DE PAGINACION DESDE EL COMBO if(this.sTipoPaginacion!=null && !this.sTipoPaginacion.equals("")) { if(!this.sTipoPaginacion.equals("TODOS")) { this.iNumeroPaginacion=Integer.parseInt(this.sTipoPaginacion); } else { this.iNumeroPaginacion=-1; this.iNumeroPaginacionPagina=-1; } } else { if(this.iNumeroPaginacion==null || (this.iNumeroPaginacion!=null && this.iNumeroPaginacion<=0)) { this.iNumeroPaginacion=ProcesoPreciosPorcentajeConstantesFunciones.INUMEROPAGINACION; } } this.pagination=new Pagination(); this.pagination.setiFirstResult(this.iNumeroPaginacionPagina); this.pagination.setiMaxResults(this.iNumeroPaginacion); this.cargarDatosCliente(); ArrayList<Classe> classes=new ArrayList<Classe>(); classes=ProcesoPreciosPorcentajeConstantesFunciones.getClassesForeignKeysOfProcesoPreciosPorcentaje(new ArrayList<Classe>(),DeepLoadType.NONE); this.datosDeep=new DatosDeep(); this.datosDeep.setIsDeep(false); this.datosDeep.setDeepLoadType(DeepLoadType.INCLUDE); this.datosDeep.setClases(classes); this.datosCliente.setDatosDeepParametros(false, DeepLoadType.INCLUDE, classes, ""); this.datosCliente.setIsConDeep(true); if(false) {//this.conExportar this.datosCliente.setIsConExportar(true); this.datosCliente.setDatosExportarParametros(Funciones2.getTipoExportar(this.parametroGeneralUsuario),this.parametroGeneralUsuario.getcon_exportar_cabecera(),Funciones2.getTipoDelimiter(this.parametroGeneralUsuario),this.parametroGeneralUsuario.getpath_exportar()+"/procesopreciosporcentaje."+Funciones2.getTipoExtensionArchivoExportar(this.parametroGeneralUsuario)); } else { this.datosCliente.setIsConExportar(false); } procesopreciosporcentajesAux= new ArrayList<ProcesoPreciosPorcentaje>(); procesopreciosporcentajeLogic.setDatosCliente(this.datosCliente); procesopreciosporcentajeLogic.setDatosDeep(this.datosDeep); procesopreciosporcentajeLogic.setIsConDeep(true); if(sAccionBusqueda.equals("Todos") || sAccionBusqueda.equals("Query")) { if(sAccionBusqueda.equals("Todos")) { //FALTA:PARA BUSQUEDAS POR CAMPO EN FORMULARIO //this.sFinalQueryGeneral=""; } } else if(sAccionBusqueda.equals("BusquedaProcesoPreciosPorcentaje")) { this.sDetalleReporte=ProcesoPreciosPorcentajeConstantesFunciones.getDetalleIndiceBusquedaProcesoPreciosPorcentaje(id_bodegaBusquedaProcesoPreciosPorcentaje,id_productoBusquedaProcesoPreciosPorcentaje,id_lineaBusquedaProcesoPreciosPorcentaje,id_linea_grupoBusquedaProcesoPreciosPorcentaje,id_linea_categoriaBusquedaProcesoPreciosPorcentaje,id_linea_marcaBusquedaProcesoPreciosPorcentaje); //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { finalQueryGlobal=Funciones.GetFinalQueryAppendBusqueda(finalQueryGlobal, this.sFinalQueryGeneral,finalQueryPaginacion); procesopreciosporcentajeLogic.getProcesoPreciosPorcentajesBusquedaProcesoPreciosPorcentaje(finalQueryGlobal,pagination,this.parametroGeneralUsuario,this.moduloActual,this.opcionActual,this.usuarioActual,id_bodegaBusquedaProcesoPreciosPorcentaje,id_productoBusquedaProcesoPreciosPorcentaje,id_lineaBusquedaProcesoPreciosPorcentaje,id_linea_grupoBusquedaProcesoPreciosPorcentaje,id_linea_categoriaBusquedaProcesoPreciosPorcentaje,id_linea_marcaBusquedaProcesoPreciosPorcentaje); } else if(Constantes.ISUSAEJBREMOTE) { this.sDetalleReporte=ProcesoPreciosPorcentajeConstantesFunciones.getDetalleIndiceBusquedaProcesoPreciosPorcentaje(id_bodegaBusquedaProcesoPreciosPorcentaje,id_productoBusquedaProcesoPreciosPorcentaje,id_lineaBusquedaProcesoPreciosPorcentaje,id_linea_grupoBusquedaProcesoPreciosPorcentaje,id_linea_categoriaBusquedaProcesoPreciosPorcentaje,id_linea_marcaBusquedaProcesoPreciosPorcentaje); } else if(Constantes.ISUSAEJBHOME) { this.sDetalleReporte=ProcesoPreciosPorcentajeConstantesFunciones.getDetalleIndiceBusquedaProcesoPreciosPorcentaje(id_bodegaBusquedaProcesoPreciosPorcentaje,id_productoBusquedaProcesoPreciosPorcentaje,id_lineaBusquedaProcesoPreciosPorcentaje,id_linea_grupoBusquedaProcesoPreciosPorcentaje,id_linea_categoriaBusquedaProcesoPreciosPorcentaje,id_linea_marcaBusquedaProcesoPreciosPorcentaje); } //ARCHITECTURE Boolean isNoExiste=false; //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { isNoExiste=procesopreciosporcentajeLogic.getProcesoPreciosPorcentajes()==null||procesopreciosporcentajeLogic.getProcesoPreciosPorcentajes().size()==0; } else if(Constantes.ISUSAEJBREMOTE||Constantes.ISUSAEJBHOME) { isNoExiste=procesopreciosporcentajes==null|| procesopreciosporcentajes.size()==0; } //ARCHITECTURE if(false && sTipoArchivoReporte!=""&&sTipoArchivoReporte!=null) {//this.isTipoArchivoReporte if(false) {//isMostrarTodosResultadosReporte this.pagination.setiFirstResult(-1); this.pagination.setiMaxResults(-1); //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { procesopreciosporcentajesAux=new ArrayList<ProcesoPreciosPorcentaje>(); procesopreciosporcentajesAux.addAll(procesopreciosporcentajeLogic.getProcesoPreciosPorcentajes()); } else if(Constantes.ISUSAEJBREMOTE || Constantes.ISUSAEJBHOME) { procesopreciosporcentajesAux=new ArrayList<ProcesoPreciosPorcentaje>(); procesopreciosporcentajesAux.addAll(procesopreciosporcentajes); } //ARCHITECTURE //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { finalQueryGlobal=Funciones.GetFinalQueryAppendBusqueda(finalQueryGlobal, this.sFinalQueryGeneral,""); procesopreciosporcentajeLogic.getProcesoPreciosPorcentajesBusquedaProcesoPreciosPorcentaje(finalQueryGlobal,pagination,this.parametroGeneralUsuario,this.moduloActual,this.opcionActual,this.usuarioActual,id_bodegaBusquedaProcesoPreciosPorcentaje,id_productoBusquedaProcesoPreciosPorcentaje,id_lineaBusquedaProcesoPreciosPorcentaje,id_linea_grupoBusquedaProcesoPreciosPorcentaje,id_linea_categoriaBusquedaProcesoPreciosPorcentaje,id_linea_marcaBusquedaProcesoPreciosPorcentaje); } else if(Constantes.ISUSAEJBREMOTE) { this.sDetalleReporte=ProcesoPreciosPorcentajeConstantesFunciones.getDetalleIndiceBusquedaProcesoPreciosPorcentaje(id_bodegaBusquedaProcesoPreciosPorcentaje,id_productoBusquedaProcesoPreciosPorcentaje,id_lineaBusquedaProcesoPreciosPorcentaje,id_linea_grupoBusquedaProcesoPreciosPorcentaje,id_linea_categoriaBusquedaProcesoPreciosPorcentaje,id_linea_marcaBusquedaProcesoPreciosPorcentaje); } else if(Constantes.ISUSAEJBHOME) { this.sDetalleReporte=ProcesoPreciosPorcentajeConstantesFunciones.getDetalleIndiceBusquedaProcesoPreciosPorcentaje(id_bodegaBusquedaProcesoPreciosPorcentaje,id_productoBusquedaProcesoPreciosPorcentaje,id_lineaBusquedaProcesoPreciosPorcentaje,id_linea_grupoBusquedaProcesoPreciosPorcentaje,id_linea_categoriaBusquedaProcesoPreciosPorcentaje,id_linea_marcaBusquedaProcesoPreciosPorcentaje); } //ARCHITECTURE } //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { generarReporteProcesoPreciosPorcentajes("BusquedaProcesoPreciosPorcentaje",procesopreciosporcentajeLogic.getProcesoPreciosPorcentajes()); } else if(Constantes.ISUSAEJBREMOTE || Constantes.ISUSAEJBHOME) { generarReporteProcesoPreciosPorcentajes("BusquedaProcesoPreciosPorcentaje",procesopreciosporcentajes); } //ARCHITECTURE if(false) {//isMostrarTodosResultadosReporte this.pagination.setiFirstResult(this.iNumeroPaginacionPagina); this.pagination.setiMaxResults(this.iNumeroPaginacion); //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { procesopreciosporcentajeLogic.setProcesoPreciosPorcentajes(new ArrayList<ProcesoPreciosPorcentaje>()); procesopreciosporcentajeLogic.getProcesoPreciosPorcentajes().addAll(procesopreciosporcentajesAux); } else if(Constantes.ISUSAEJBREMOTE || Constantes.ISUSAEJBHOME) { procesopreciosporcentajes=new ArrayList<ProcesoPreciosPorcentaje>(); procesopreciosporcentajes.addAll(procesopreciosporcentajesAux); } //ARCHITECTURE } } } this.redimensionarTablaDatos(); //this.refrescarForeignKeysDescripcionesProcesoPreciosPorcentaje(); if(this.conTotales) { this.crearFilaTotales(); } } catch (JRException e) { throw e; } catch(Exception e) { throw e; } finally { //this.finishProcessProcesoPreciosPorcentaje(); } } public void redimensionarTablaDatos() throws Exception { int iSizeTabla=0; iSizeTabla=this.getSizeTablaDatos(); //ARCHITECTURE /* if(Constantes.ISUSAEJBLOGICLAYER) { iSizeTabla=procesopreciosporcentajeLogic.getProcesoPreciosPorcentajes().size(); } else if(Constantes.ISUSAEJBREMOTE || Constantes.ISUSAEJBHOME) { iSizeTabla=procesopreciosporcentajes.size(); } */ //ARCHITECTURE this.redimensionarTablaDatos(iSizeTabla); } public Integer getSizeTablaDatos() throws Exception { Integer iSizeTabla=0; //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { iSizeTabla=procesopreciosporcentajeLogic.getProcesoPreciosPorcentajes().size(); } else if(Constantes.ISUSAEJBREMOTE || Constantes.ISUSAEJBHOME) { iSizeTabla=procesopreciosporcentajes.size(); } //ARCHITECTURE return iSizeTabla; } public Boolean permiteMantenimiento(ProcesoPreciosPorcentaje procesopreciosporcentaje) { Boolean permite=true; if(this.procesopreciosporcentaje.getsType().equals(Constantes2.S_TOTALES)) { permite=false; } return permite; } public void traerValoresTablaTotales() throws Exception { } public void traerValoresTablaOrderBy() throws Exception { if(Constantes.ISUSAEJBLOGICLAYER) { this.arrOrderBy=ProcesoPreciosPorcentajeConstantesFunciones.getOrderByListaProcesoPreciosPorcentaje(); } else if(Constantes.ISUSAEJBREMOTE || Constantes.ISUSAEJBHOME) { this.arrOrderBy=ProcesoPreciosPorcentajeConstantesFunciones.getOrderByListaProcesoPreciosPorcentaje(); } } public Boolean existeFilaTotales() throws Exception { Boolean existe=false; if(Constantes.ISUSAEJBLOGICLAYER) { for(ProcesoPreciosPorcentaje procesopreciosporcentaje:procesopreciosporcentajeLogic.getProcesoPreciosPorcentajes()) { if(procesopreciosporcentaje.getsType().equals(Constantes2.S_TOTALES)) { procesopreciosporcentajeTotales=procesopreciosporcentaje; existe=true; break; } } } else if(Constantes.ISUSAEJBREMOTE || Constantes.ISUSAEJBHOME) { for(ProcesoPreciosPorcentaje procesopreciosporcentaje:this.procesopreciosporcentajes) { if(procesopreciosporcentaje.getsType().equals(Constantes2.S_TOTALES)) { procesopreciosporcentajeTotales=procesopreciosporcentaje; existe=true; break; } } } return existe; } public void crearFilaTotales() throws Exception { Boolean existe=false; existe=this.existeFilaTotales(); if(!existe) { //SI NO ES UNO A UNO SE CREA FILA TOTALES this.procesopreciosporcentajeAux=new ProcesoPreciosPorcentaje(); this.procesopreciosporcentajeAux.setsType(Constantes2.S_TOTALES); this.procesopreciosporcentajeAux.setIsNew(false); this.procesopreciosporcentajeAux.setIsChanged(false); this.procesopreciosporcentajeAux.setIsDeleted(false); if(Constantes.ISUSAEJBLOGICLAYER) { //ProcesoPreciosPorcentajeConstantesFunciones.TotalizarValoresFilaProcesoPreciosPorcentaje(this.procesopreciosporcentajeLogic.getProcesoPreciosPorcentajes(),this.procesopreciosporcentajeAux); //this.procesopreciosporcentajeLogic.getProcesoPreciosPorcentajes().add(this.procesopreciosporcentajeAux); } else if(Constantes.ISUSAEJBREMOTE || Constantes.ISUSAEJBHOME) { ProcesoPreciosPorcentajeConstantesFunciones.TotalizarValoresFilaProcesoPreciosPorcentaje(this.procesopreciosporcentajes,this.procesopreciosporcentajeAux); this.procesopreciosporcentajes.add(this.procesopreciosporcentajeAux); } } } public void quitarFilaTotales() throws Exception { procesopreciosporcentajeTotales=new ProcesoPreciosPorcentaje(); Boolean existe=false; if(Constantes.ISUSAEJBLOGICLAYER) { existe=this.existeFilaTotales(); if(existe) { this.procesopreciosporcentajeLogic.getProcesoPreciosPorcentajes().remove(procesopreciosporcentajeTotales); } } else if(Constantes.ISUSAEJBREMOTE || Constantes.ISUSAEJBHOME) { existe=this.existeFilaTotales(); if(existe) { this.procesopreciosporcentajes.remove(procesopreciosporcentajeTotales); } } } public void actualizarFilaTotales() throws Exception { procesopreciosporcentajeTotales=new ProcesoPreciosPorcentaje(); Boolean existe=false; if(Constantes.ISUSAEJBLOGICLAYER) { for(ProcesoPreciosPorcentaje procesopreciosporcentaje:procesopreciosporcentajeLogic.getProcesoPreciosPorcentajes()) { if(procesopreciosporcentaje.getsType().equals(Constantes2.S_TOTALES)) { procesopreciosporcentajeTotales=procesopreciosporcentaje; existe=true; break; } } if(existe) { ProcesoPreciosPorcentajeConstantesFunciones.TotalizarValoresFilaProcesoPreciosPorcentaje(this.procesopreciosporcentajeLogic.getProcesoPreciosPorcentajes(),procesopreciosporcentajeTotales); } } else if(Constantes.ISUSAEJBREMOTE || Constantes.ISUSAEJBHOME) { for(ProcesoPreciosPorcentaje procesopreciosporcentaje:this.procesopreciosporcentajes) { if(procesopreciosporcentaje.getsType().equals(Constantes2.S_TOTALES)) { procesopreciosporcentajeTotales=procesopreciosporcentaje; existe=true; break; } } if(existe) { ProcesoPreciosPorcentajeConstantesFunciones.TotalizarValoresFilaProcesoPreciosPorcentaje(this.procesopreciosporcentajes,procesopreciosporcentajeTotales); } } } public void recargarInformacion()throws Exception { try { sAccionBusqueda="Todos"; this.iNumeroPaginacionPagina=0; this.procesarBusqueda(sAccionBusqueda); } catch(Exception e) { FuncionesSwing.manageException(this, e,logger,ProcesoPreciosPorcentajeConstantesFunciones.CLASSNAME); } } public void getProcesoPreciosPorcentajesBusquedaProcesoPreciosPorcentaje()throws Exception { try { sAccionBusqueda="BusquedaProcesoPreciosPorcentaje"; this.iNumeroPaginacionPagina=0; this.procesarBusqueda(sAccionBusqueda); } catch(Exception e) { FuncionesSwing.manageException(this, e,logger); } } public void getProcesoPreciosPorcentajesFK_IdBodega()throws Exception { try { sAccionBusqueda="FK_IdBodega"; this.iNumeroPaginacionPagina=0; this.procesarBusqueda(sAccionBusqueda); } catch(Exception e) { FuncionesSwing.manageException(this, e,logger); } } public void getProcesoPreciosPorcentajesFK_IdEmpresa()throws Exception { try { sAccionBusqueda="FK_IdEmpresa"; this.iNumeroPaginacionPagina=0; this.procesarBusqueda(sAccionBusqueda); } catch(Exception e) { FuncionesSwing.manageException(this, e,logger); } } public void getProcesoPreciosPorcentajesFK_IdLinea()throws Exception { try { sAccionBusqueda="FK_IdLinea"; this.iNumeroPaginacionPagina=0; this.procesarBusqueda(sAccionBusqueda); } catch(Exception e) { FuncionesSwing.manageException(this, e,logger); } } public void getProcesoPreciosPorcentajesFK_IdLineaCategoria()throws Exception { try { sAccionBusqueda="FK_IdLineaCategoria"; this.iNumeroPaginacionPagina=0; this.procesarBusqueda(sAccionBusqueda); } catch(Exception e) { FuncionesSwing.manageException(this, e,logger); } } public void getProcesoPreciosPorcentajesFK_IdLineaGrupo()throws Exception { try { sAccionBusqueda="FK_IdLineaGrupo"; this.iNumeroPaginacionPagina=0; this.procesarBusqueda(sAccionBusqueda); } catch(Exception e) { FuncionesSwing.manageException(this, e,logger); } } public void getProcesoPreciosPorcentajesFK_IdLineaMarca()throws Exception { try { sAccionBusqueda="FK_IdLineaMarca"; this.iNumeroPaginacionPagina=0; this.procesarBusqueda(sAccionBusqueda); } catch(Exception e) { FuncionesSwing.manageException(this, e,logger); } } public void getProcesoPreciosPorcentajesFK_IdProducto()throws Exception { try { sAccionBusqueda="FK_IdProducto"; this.iNumeroPaginacionPagina=0; this.procesarBusqueda(sAccionBusqueda); } catch(Exception e) { FuncionesSwing.manageException(this, e,logger); } } public void getProcesoPreciosPorcentajesFK_IdSucursal()throws Exception { try { sAccionBusqueda="FK_IdSucursal"; this.iNumeroPaginacionPagina=0; this.procesarBusqueda(sAccionBusqueda); } catch(Exception e) { FuncionesSwing.manageException(this, e,logger); } } public void getProcesoPreciosPorcentajesBusquedaProcesoPreciosPorcentaje(String sFinalQuery,Long id_bodega,Long id_producto,Long id_linea,Long id_linea_grupo,Long id_linea_categoria,Long id_linea_marca)throws Exception { try { this.pagination=new Pagination(); this.pagination.setiFirstResult(this.iNumeroPaginacionPagina); this.pagination.setiMaxResults(this.iNumeroPaginacion); //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { //procesopreciosporcentajeLogic.getProcesoPreciosPorcentajesBusquedaProcesoPreciosPorcentaje(sFinalQuery,this.pagination,id_bodega,id_producto,id_linea,id_linea_grupo,id_linea_categoria,id_linea_marca); } else if(Constantes.ISUSAEJBREMOTE) { } else if(Constantes.ISUSAEJBHOME) { } //ARCHITECTURE } catch(Exception e) { throw e; } } public void getProcesoPreciosPorcentajesFK_IdBodega(String sFinalQuery,Long id_bodega)throws Exception { try { this.pagination=new Pagination(); this.pagination.setiFirstResult(this.iNumeroPaginacionPagina); this.pagination.setiMaxResults(this.iNumeroPaginacion); //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { //procesopreciosporcentajeLogic.getProcesoPreciosPorcentajesFK_IdBodega(sFinalQuery,this.pagination,id_bodega); } else if(Constantes.ISUSAEJBREMOTE) { } else if(Constantes.ISUSAEJBHOME) { } //ARCHITECTURE } catch(Exception e) { throw e; } } public void getProcesoPreciosPorcentajesFK_IdEmpresa(String sFinalQuery,Long id_empresa)throws Exception { try { this.pagination=new Pagination(); this.pagination.setiFirstResult(this.iNumeroPaginacionPagina); this.pagination.setiMaxResults(this.iNumeroPaginacion); //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { //procesopreciosporcentajeLogic.getProcesoPreciosPorcentajesFK_IdEmpresa(sFinalQuery,this.pagination,id_empresa); } else if(Constantes.ISUSAEJBREMOTE) { } else if(Constantes.ISUSAEJBHOME) { } //ARCHITECTURE } catch(Exception e) { throw e; } } public void getProcesoPreciosPorcentajesFK_IdLinea(String sFinalQuery,Long id_linea)throws Exception { try { this.pagination=new Pagination(); this.pagination.setiFirstResult(this.iNumeroPaginacionPagina); this.pagination.setiMaxResults(this.iNumeroPaginacion); //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { //procesopreciosporcentajeLogic.getProcesoPreciosPorcentajesFK_IdLinea(sFinalQuery,this.pagination,id_linea); } else if(Constantes.ISUSAEJBREMOTE) { } else if(Constantes.ISUSAEJBHOME) { } //ARCHITECTURE } catch(Exception e) { throw e; } } public void getProcesoPreciosPorcentajesFK_IdLineaCategoria(String sFinalQuery,Long id_linea_categoria)throws Exception { try { this.pagination=new Pagination(); this.pagination.setiFirstResult(this.iNumeroPaginacionPagina); this.pagination.setiMaxResults(this.iNumeroPaginacion); //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { //procesopreciosporcentajeLogic.getProcesoPreciosPorcentajesFK_IdLineaCategoria(sFinalQuery,this.pagination,id_linea_categoria); } else if(Constantes.ISUSAEJBREMOTE) { } else if(Constantes.ISUSAEJBHOME) { } //ARCHITECTURE } catch(Exception e) { throw e; } } public void getProcesoPreciosPorcentajesFK_IdLineaGrupo(String sFinalQuery,Long id_linea_grupo)throws Exception { try { this.pagination=new Pagination(); this.pagination.setiFirstResult(this.iNumeroPaginacionPagina); this.pagination.setiMaxResults(this.iNumeroPaginacion); //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { //procesopreciosporcentajeLogic.getProcesoPreciosPorcentajesFK_IdLineaGrupo(sFinalQuery,this.pagination,id_linea_grupo); } else if(Constantes.ISUSAEJBREMOTE) { } else if(Constantes.ISUSAEJBHOME) { } //ARCHITECTURE } catch(Exception e) { throw e; } } public void getProcesoPreciosPorcentajesFK_IdLineaMarca(String sFinalQuery,Long id_linea_marca)throws Exception { try { this.pagination=new Pagination(); this.pagination.setiFirstResult(this.iNumeroPaginacionPagina); this.pagination.setiMaxResults(this.iNumeroPaginacion); //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { //procesopreciosporcentajeLogic.getProcesoPreciosPorcentajesFK_IdLineaMarca(sFinalQuery,this.pagination,id_linea_marca); } else if(Constantes.ISUSAEJBREMOTE) { } else if(Constantes.ISUSAEJBHOME) { } //ARCHITECTURE } catch(Exception e) { throw e; } } public void getProcesoPreciosPorcentajesFK_IdProducto(String sFinalQuery,Long id_producto)throws Exception { try { this.pagination=new Pagination(); this.pagination.setiFirstResult(this.iNumeroPaginacionPagina); this.pagination.setiMaxResults(this.iNumeroPaginacion); //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { //procesopreciosporcentajeLogic.getProcesoPreciosPorcentajesFK_IdProducto(sFinalQuery,this.pagination,id_producto); } else if(Constantes.ISUSAEJBREMOTE) { } else if(Constantes.ISUSAEJBHOME) { } //ARCHITECTURE } catch(Exception e) { throw e; } } public void getProcesoPreciosPorcentajesFK_IdSucursal(String sFinalQuery,Long id_sucursal)throws Exception { try { this.pagination=new Pagination(); this.pagination.setiFirstResult(this.iNumeroPaginacionPagina); this.pagination.setiMaxResults(this.iNumeroPaginacion); //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { //procesopreciosporcentajeLogic.getProcesoPreciosPorcentajesFK_IdSucursal(sFinalQuery,this.pagination,id_sucursal); } else if(Constantes.ISUSAEJBREMOTE) { } else if(Constantes.ISUSAEJBHOME) { } //ARCHITECTURE } catch(Exception e) { throw e; } } public void onLoad()throws Exception { try { isEntroOnLoad=true; //INTENTA TRAER DATOS DE BUSQUEDA ANTERIOR this.traerDatosBusquedaDesdeSession(); //SINO SE CUMPLE VIENE DE PADRE FOREIGN O BUSQUEDA ANTIGUA if(this.sAccionBusqueda.equals("")) { this.sAccionBusqueda="Todos"; } //this.procesarBusqueda(sAccionBusqueda); } catch (Exception e) { throw e; } } public void inicializarPermisosProcesoPreciosPorcentaje() { this.isPermisoTodoProcesoPreciosPorcentaje=false; this.isPermisoNuevoProcesoPreciosPorcentaje=false; this.isPermisoActualizarProcesoPreciosPorcentaje=false; this.isPermisoActualizarOriginalProcesoPreciosPorcentaje=false; this.isPermisoEliminarProcesoPreciosPorcentaje=false; this.isPermisoGuardarCambiosProcesoPreciosPorcentaje=false; this.isPermisoConsultaProcesoPreciosPorcentaje=true; this.isPermisoBusquedaProcesoPreciosPorcentaje=true; this.isPermisoReporteProcesoPreciosPorcentaje=true; this.isPermisoOrdenProcesoPreciosPorcentaje=false; this.isPermisoPaginacionMedioProcesoPreciosPorcentaje=false; this.isPermisoPaginacionAltoProcesoPreciosPorcentaje=false; this.isPermisoPaginacionTodoProcesoPreciosPorcentaje=false; this.isPermisoCopiarProcesoPreciosPorcentaje=false; this.isPermisoVerFormProcesoPreciosPorcentaje=false; this.isPermisoDuplicarProcesoPreciosPorcentaje=false; this.isPermisoOrdenProcesoPreciosPorcentaje=false; } public void setPermisosUsuarioProcesoPreciosPorcentaje(Boolean isPermiso) { this.isPermisoTodoProcesoPreciosPorcentaje=isPermiso; this.isPermisoNuevoProcesoPreciosPorcentaje=isPermiso; this.isPermisoActualizarProcesoPreciosPorcentaje=isPermiso; this.isPermisoActualizarOriginalProcesoPreciosPorcentaje=isPermiso; this.isPermisoEliminarProcesoPreciosPorcentaje=isPermiso; this.isPermisoGuardarCambiosProcesoPreciosPorcentaje=isPermiso; this.isPermisoConsultaProcesoPreciosPorcentaje=isPermiso; this.isPermisoBusquedaProcesoPreciosPorcentaje=isPermiso; this.isPermisoReporteProcesoPreciosPorcentaje=isPermiso; this.isPermisoOrdenProcesoPreciosPorcentaje=isPermiso; this.isPermisoPaginacionMedioProcesoPreciosPorcentaje=isPermiso; this.isPermisoPaginacionAltoProcesoPreciosPorcentaje=isPermiso; this.isPermisoPaginacionTodoProcesoPreciosPorcentaje=isPermiso; this.isPermisoCopiarProcesoPreciosPorcentaje=isPermiso; this.isPermisoVerFormProcesoPreciosPorcentaje=isPermiso; this.isPermisoDuplicarProcesoPreciosPorcentaje=isPermiso; this.isPermisoOrdenProcesoPreciosPorcentaje=isPermiso; } public void setPermisosMantenimientoUsuarioProcesoPreciosPorcentaje(Boolean isPermiso) { //this.isPermisoTodoProcesoPreciosPorcentaje=isPermiso; this.isPermisoNuevoProcesoPreciosPorcentaje=isPermiso; this.isPermisoActualizarProcesoPreciosPorcentaje=isPermiso; this.isPermisoActualizarOriginalProcesoPreciosPorcentaje=isPermiso; this.isPermisoEliminarProcesoPreciosPorcentaje=isPermiso; this.isPermisoGuardarCambiosProcesoPreciosPorcentaje=isPermiso; //this.isPermisoConsultaProcesoPreciosPorcentaje=isPermiso; //this.isPermisoBusquedaProcesoPreciosPorcentaje=isPermiso; //this.isPermisoReporteProcesoPreciosPorcentaje=isPermiso; //this.isPermisoOrdenProcesoPreciosPorcentaje=isPermiso; //this.isPermisoPaginacionMedioProcesoPreciosPorcentaje=isPermiso; //this.isPermisoPaginacionAltoProcesoPreciosPorcentaje=isPermiso; //this.isPermisoPaginacionTodoProcesoPreciosPorcentaje=isPermiso; //this.isPermisoCopiarProcesoPreciosPorcentaje=isPermiso; //this.isPermisoDuplicarProcesoPreciosPorcentaje=isPermiso; //this.isPermisoOrdenProcesoPreciosPorcentaje=isPermiso; } public void inicializarSetPermisosUsuarioProcesoPreciosPorcentajeClasesRelacionadas() throws Exception { ArrayList<String> arrPaginas=new ArrayList<String>(); ArrayList<Opcion> opcionsFinal=new ArrayList<Opcion>(); if(ProcesoPreciosPorcentajeJInternalFrame.CON_LLAMADA_SIMPLE) { this.opcionsRelacionadas.addAll(this.sistemaReturnGeneral.getOpcionsRelacionadas()); } else { if(Constantes.ISUSAEJBLOGICLAYER) { opcionsFinal=sistemaLogicAdditional.tienePermisosOpcionesEnPaginaWeb(this.usuarioActual, Constantes.LIDSISTEMAACTUAL, arrPaginas); } else if(Constantes.ISUSAEJBREMOTE) { } else if(Constantes.ISUSAEJBHOME) { } this.opcionsRelacionadas.addAll(opcionsFinal); } } public Boolean tienePermisosUsuarioEnPaginaWebProcesoPreciosPorcentaje(String sPagina) throws Exception { Boolean tienePermisos=false; if(Constantes.ISUSAEJBLOGICLAYER) { tienePermisos=sistemaLogicAdditional.tienePermisosEnPaginaWeb(this.usuarioActual, Constantes.LIDSISTEMAACTUAL, sPagina); } else if(Constantes.ISUSAEJBREMOTE) { } else if(Constantes.ISUSAEJBHOME) { } return tienePermisos; } public void inicializarSetPermisosUsuarioProcesoPreciosPorcentajeClasesRelacionadas(Boolean conPermiso) throws Exception { } public Boolean verificarGetPermisosUsuarioProcesoPreciosPorcentajeClaseRelacionada(ArrayList<String> arrPaginasFinal,String sPaginaActual) throws Exception { Boolean verificado=false; verificado=Funciones2.verificarGetPermisosUsuarioClaseRelacionada(arrPaginasFinal,sPaginaActual); return verificado; } public Boolean verificarGetPermisosUsuarioOpcionProcesoPreciosPorcentajeClaseRelacionada(List<Opcion> opcionsFinal,String sPaginaActual) throws Exception { Boolean verificado=false; verificado=Funciones2.verificarGetPermisosUsuarioOpcionClaseRelacionada(opcionsFinal,sPaginaActual); return verificado; } public void actualizarTabsSetPermisosUsuarioProcesoPreciosPorcentajeClasesRelacionadas() throws Exception { } public void setPermisosUsuarioProcesoPreciosPorcentaje() throws Exception { PerfilOpcion perfilOpcionUsuario=new PerfilOpcion(); Long idOpcion=this.opcionActual.getId(); if(ProcesoPreciosPorcentajeJInternalFrame.CON_LLAMADA_SIMPLE) { perfilOpcionUsuario=this.sistemaReturnGeneral.getPerfilOpcion(); } else { if(this.procesopreciosporcentajeSessionBean.getEsGuardarRelacionado()) { idOpcion=0L; } if(Constantes.ISUSAEJBLOGICLAYER) { perfilOpcionUsuario=sistemaLogicAdditional.traerPermisosPaginaWebPerfilOpcion(this.usuarioActual, Constantes.LIDSISTEMAACTUAL, ProcesoPreciosPorcentajeConstantesFunciones.SNOMBREOPCION,idOpcion); } else if(Constantes.ISUSAEJBREMOTE) { } else if(Constantes.ISUSAEJBHOME) { } } if(perfilOpcionUsuario!=null && perfilOpcionUsuario.getId()>0) { this.isPermisoNuevoProcesoPreciosPorcentaje=perfilOpcionUsuario.getingreso()||perfilOpcionUsuario.gettodo(); this.isPermisoActualizarProcesoPreciosPorcentaje=perfilOpcionUsuario.getmodificacion()||perfilOpcionUsuario.gettodo(); this.isPermisoActualizarOriginalProcesoPreciosPorcentaje=this.isPermisoActualizarProcesoPreciosPorcentaje; this.isPermisoEliminarProcesoPreciosPorcentaje=perfilOpcionUsuario.geteliminacion()||perfilOpcionUsuario.gettodo(); this.isPermisoGuardarCambiosProcesoPreciosPorcentaje=perfilOpcionUsuario.getguardar_cambios()||perfilOpcionUsuario.gettodo(); this.isPermisoConsultaProcesoPreciosPorcentaje=perfilOpcionUsuario.getconsulta()||perfilOpcionUsuario.gettodo(); this.isPermisoBusquedaProcesoPreciosPorcentaje=perfilOpcionUsuario.getbusqueda()||perfilOpcionUsuario.gettodo(); this.isPermisoTodoProcesoPreciosPorcentaje=perfilOpcionUsuario.gettodo()||perfilOpcionUsuario.gettodo(); this.isPermisoReporteProcesoPreciosPorcentaje=perfilOpcionUsuario.getreporte()||perfilOpcionUsuario.gettodo(); this.isPermisoOrdenProcesoPreciosPorcentaje=perfilOpcionUsuario.getorden()||perfilOpcionUsuario.gettodo(); this.isPermisoPaginacionMedioProcesoPreciosPorcentaje=perfilOpcionUsuario.getpaginacion_medio()||perfilOpcionUsuario.gettodo(); this.isPermisoPaginacionAltoProcesoPreciosPorcentaje=perfilOpcionUsuario.getpaginacion_alto()||perfilOpcionUsuario.gettodo(); this.isPermisoPaginacionTodoProcesoPreciosPorcentaje=perfilOpcionUsuario.getpaginacion_todo()||perfilOpcionUsuario.gettodo(); this.isPermisoCopiarProcesoPreciosPorcentaje=perfilOpcionUsuario.getcopiar()||perfilOpcionUsuario.gettodo(); this.isPermisoVerFormProcesoPreciosPorcentaje=true;//perfilOpcionUsuario.getver_form()||perfilOpcionUsuario.gettodo(); this.isPermisoDuplicarProcesoPreciosPorcentaje=perfilOpcionUsuario.getduplicar()||perfilOpcionUsuario.gettodo(); this.isPermisoOrdenProcesoPreciosPorcentaje=perfilOpcionUsuario.getorden()||perfilOpcionUsuario.gettodo(); if(this.procesopreciosporcentajeSessionBean.getEsGuardarRelacionado()) { this.opcionActual.setId(perfilOpcionUsuario.getid_opcion()); this.jTableDatosProcesoPreciosPorcentaje.setToolTipText(this.jTableDatosProcesoPreciosPorcentaje.getToolTipText()+"_"+perfilOpcionUsuario.getid_opcion()); } } else { this.setPermisosUsuarioProcesoPreciosPorcentaje(false); } //SI SE NECESITA PONER TODOS LOS PERMISOS POR DEFECTO // } public void setAccionesUsuarioProcesoPreciosPorcentaje(Boolean esParaAccionesFormulario) throws Exception { Reporte reporte=null; if(!esParaAccionesFormulario) { this.accions=new ArrayList<Accion>(); if(ProcesoPreciosPorcentajeJInternalFrame.CON_LLAMADA_SIMPLE) { this.accions=this.sistemaReturnGeneral.getAccions(); } else { if(Constantes.ISUSAEJBLOGICLAYER) { this.accions=sistemaLogicAdditional.getAccionesUsuario(this.usuarioActual,this.opcionActual,false); } else if(Constantes.ISUSAEJBREMOTE) { } else if(Constantes.ISUSAEJBHOME) { } } if(this.accions.size()>0) { for(Accion accion:this.accions) { reporte=new Reporte(); reporte.setsCodigo(accion.getcodigo()); reporte.setsDescripcion(accion.getnombre()); this.tiposAcciones.add(reporte); } } reporte=new Reporte(); reporte.setsCodigo(""); reporte.setsDescripcion(""); this.tiposAcciones.add(reporte); } else { //ACCIONES FORMULARIO this.accionsFormulario=new ArrayList<Accion>(); if(ProcesoPreciosPorcentajeJInternalFrame.CON_LLAMADA_SIMPLE) { this.accionsFormulario=this.sistemaReturnGeneral.getAccionsFormulario(); } else { if(Constantes.ISUSAEJBLOGICLAYER) { this.accionsFormulario=sistemaLogicAdditional.getAccionesUsuario(this.usuarioActual,this.opcionActual,true); } else if(Constantes.ISUSAEJBREMOTE) { } else if(Constantes.ISUSAEJBHOME) { } } if(this.accionsFormulario.size()>0) { for(Accion accion:this.accionsFormulario) { reporte=new Reporte(); reporte.setsCodigo(accion.getcodigo()); reporte.setsDescripcion(accion.getnombre()); this.tiposAccionesFormulario.add(reporte); } } reporte=new Reporte(); reporte.setsCodigo(""); reporte.setsDescripcion(""); this.tiposAccionesFormulario.add(reporte); } } public void setRelacionesUsuarioProcesoPreciosPorcentaje() throws Exception { Reporte reporte=null; //ORDENAR ALFABETICAMENTE Collections.sort(this.tiposRelaciones, new ReporteComparator()); /* reporte=new Reporte(); reporte.setsCodigo(accion.getcodigo()); reporte.setsDescripcion(accion.getnombre()); this.tiposRelaciones.add(reporte); */ } @SuppressWarnings({ "unchecked", "rawtypes" } ) public void inicializarCombosForeignKeyProcesoPreciosPorcentajeListas()throws Exception { try { this.bodegasForeignKey=new ArrayList(); this.productosForeignKey=new ArrayList(); this.empresasForeignKey=new ArrayList(); this.sucursalsForeignKey=new ArrayList(); this.lineasForeignKey=new ArrayList(); this.lineagruposForeignKey=new ArrayList(); this.lineacategoriasForeignKey=new ArrayList(); this.lineamarcasForeignKey=new ArrayList(); } catch(Exception e) { throw e; } } public void cargarCombosTodosForeignKeyProcesoPreciosPorcentajeListas(Boolean cargarCombosDependencia)throws Exception { try { ArrayList<String> arrColumnasGlobales=new ArrayList<String>(); String finalQueryGlobal=""; String sFinalQueryCombo=""; Modulo moduloActualAux=new Modulo(); if(ProcesoPreciosPorcentajeJInternalFrame.ISLOAD_FKLOTE) { } else { this.cargarCombosForeignKeyBodegaListas(cargarCombosDependencia,sFinalQueryCombo); this.cargarCombosForeignKeyProductoListas(cargarCombosDependencia,sFinalQueryCombo); this.cargarCombosForeignKeyEmpresaListas(cargarCombosDependencia,sFinalQueryCombo); this.cargarCombosForeignKeySucursalListas(cargarCombosDependencia,sFinalQueryCombo); this.cargarCombosForeignKeyLineaListas(cargarCombosDependencia,sFinalQueryCombo); this.cargarCombosForeignKeyLineaGrupoListas(cargarCombosDependencia,sFinalQueryCombo); this.cargarCombosForeignKeyLineaCategoriaListas(cargarCombosDependencia,sFinalQueryCombo); this.cargarCombosForeignKeyLineaMarcaListas(cargarCombosDependencia,sFinalQueryCombo); } } catch(Exception e) { throw e; } } public void cargarCombosForeignKeyBodegaListas(Boolean cargarCombosDependencia,String sFinalQuery)throws Exception { try { ArrayList<String> arrColumnasGlobales=new ArrayList<String>(); String finalQueryGlobal=""; Modulo moduloActualAux=new Modulo(); if((this.bodegasForeignKey==null||this.bodegasForeignKey.size()<=0)) { this.arrDatoGeneral= new ArrayList<DatoGeneral>(); this.arrDatoGeneralNo= new ArrayList<String>(); arrColumnasGlobales=BodegaConstantesFunciones.getArrayColumnasGlobalesBodega(this.arrDatoGeneral,this.arrDatoGeneralNo); finalQueryGlobal=Funciones.GetWhereGlobalConstants(this.parametroGeneralUsuario,this.moduloActual,true,false,arrColumnasGlobales,BodegaConstantesFunciones.TABLENAME); finalQueryGlobal=Funciones.GetFinalQueryAppend(finalQueryGlobal, sFinalQuery); finalQueryGlobal=Funciones.GetFinalQueryAppend(finalQueryGlobal, ""); finalQueryGlobal+=BodegaConstantesFunciones.SFINALQUERY; this.cargarCombosBodegasForeignKeyLista(finalQueryGlobal); } } catch(Exception e) { throw e; } } public void cargarCombosForeignKeyProductoListas(Boolean cargarCombosDependencia,String sFinalQuery)throws Exception { try { ArrayList<String> arrColumnasGlobales=new ArrayList<String>(); String finalQueryGlobal=""; Modulo moduloActualAux=new Modulo(); if((this.productosForeignKey==null||this.productosForeignKey.size()<=0)) { this.arrDatoGeneral= new ArrayList<DatoGeneral>(); this.arrDatoGeneralNo= new ArrayList<String>(); arrColumnasGlobales=ProductoConstantesFunciones.getArrayColumnasGlobalesProducto(this.arrDatoGeneral,this.arrDatoGeneralNo); finalQueryGlobal=Funciones.GetWhereGlobalConstants(this.parametroGeneralUsuario,this.moduloActual,true,false,arrColumnasGlobales,ProductoConstantesFunciones.TABLENAME); finalQueryGlobal=Funciones.GetFinalQueryAppend(finalQueryGlobal, sFinalQuery); finalQueryGlobal=Funciones.GetFinalQueryAppend(finalQueryGlobal, ""); finalQueryGlobal+=ProductoConstantesFunciones.SFINALQUERY; this.cargarCombosProductosForeignKeyLista(finalQueryGlobal); } } catch(Exception e) { throw e; } } public void cargarCombosForeignKeyEmpresaListas(Boolean cargarCombosDependencia,String sFinalQuery)throws Exception { try { ArrayList<String> arrColumnasGlobales=new ArrayList<String>(); String finalQueryGlobal=""; Modulo moduloActualAux=new Modulo(); if((this.empresasForeignKey==null||this.empresasForeignKey.size()<=0)) { this.arrDatoGeneral= new ArrayList<DatoGeneral>(); this.arrDatoGeneralNo= new ArrayList<String>(); arrColumnasGlobales=EmpresaConstantesFunciones.getArrayColumnasGlobalesEmpresa(this.arrDatoGeneral,this.arrDatoGeneralNo); finalQueryGlobal=Funciones.GetWhereGlobalConstants(this.parametroGeneralUsuario,this.moduloActual,true,false,arrColumnasGlobales,EmpresaConstantesFunciones.TABLENAME); finalQueryGlobal=Funciones.GetFinalQueryAppend(finalQueryGlobal, sFinalQuery); finalQueryGlobal=Funciones.GetFinalQueryAppend(finalQueryGlobal, ""); finalQueryGlobal+=EmpresaConstantesFunciones.SFINALQUERY; this.cargarCombosEmpresasForeignKeyLista(finalQueryGlobal); } } catch(Exception e) { throw e; } } public void cargarCombosForeignKeySucursalListas(Boolean cargarCombosDependencia,String sFinalQuery)throws Exception { try { ArrayList<String> arrColumnasGlobales=new ArrayList<String>(); String finalQueryGlobal=""; Modulo moduloActualAux=new Modulo(); if((this.sucursalsForeignKey==null||this.sucursalsForeignKey.size()<=0)) { this.arrDatoGeneral= new ArrayList<DatoGeneral>(); this.arrDatoGeneralNo= new ArrayList<String>(); arrColumnasGlobales=SucursalConstantesFunciones.getArrayColumnasGlobalesSucursal(this.arrDatoGeneral,this.arrDatoGeneralNo); finalQueryGlobal=Funciones.GetWhereGlobalConstants(this.parametroGeneralUsuario,this.moduloActual,true,false,arrColumnasGlobales,SucursalConstantesFunciones.TABLENAME); finalQueryGlobal=Funciones.GetFinalQueryAppend(finalQueryGlobal, sFinalQuery); finalQueryGlobal=Funciones.GetFinalQueryAppend(finalQueryGlobal, ""); finalQueryGlobal+=SucursalConstantesFunciones.SFINALQUERY; this.cargarCombosSucursalsForeignKeyLista(finalQueryGlobal); } } catch(Exception e) { throw e; } } public void cargarCombosForeignKeyLineaListas(Boolean cargarCombosDependencia,String sFinalQuery)throws Exception { try { ArrayList<String> arrColumnasGlobales=new ArrayList<String>(); String finalQueryGlobal=""; Modulo moduloActualAux=new Modulo(); if((this.lineasForeignKey==null||this.lineasForeignKey.size()<=0)) { this.arrDatoGeneral= new ArrayList<DatoGeneral>(); this.arrDatoGeneralNo= new ArrayList<String>(); arrColumnasGlobales=LineaConstantesFunciones.getArrayColumnasGlobalesLinea(this.arrDatoGeneral,this.arrDatoGeneralNo); finalQueryGlobal=Funciones.GetWhereGlobalConstants(this.parametroGeneralUsuario,this.moduloActual,true,false,arrColumnasGlobales,LineaConstantesFunciones.TABLENAME); finalQueryGlobal=Funciones.GetFinalQueryAppend(finalQueryGlobal, sFinalQuery); finalQueryGlobal=Funciones.GetFinalQueryAppend(finalQueryGlobal, ""); finalQueryGlobal+=LineaConstantesFunciones.SFINALQUERY; this.cargarCombosLineasForeignKeyLista(finalQueryGlobal); } } catch(Exception e) { throw e; } } public void cargarCombosForeignKeyLineaGrupoListas(Boolean cargarCombosDependencia,String sFinalQuery)throws Exception { try { ArrayList<String> arrColumnasGlobales=new ArrayList<String>(); String finalQueryGlobal=""; Modulo moduloActualAux=new Modulo(); if((this.lineagruposForeignKey==null||this.lineagruposForeignKey.size()<=0)) { this.arrDatoGeneral= new ArrayList<DatoGeneral>(); this.arrDatoGeneralNo= new ArrayList<String>(); arrColumnasGlobales=LineaConstantesFunciones.getArrayColumnasGlobalesLinea(this.arrDatoGeneral,this.arrDatoGeneralNo); finalQueryGlobal=Funciones.GetWhereGlobalConstants(this.parametroGeneralUsuario,this.moduloActual,true,false,arrColumnasGlobales,LineaConstantesFunciones.TABLENAME); finalQueryGlobal=Funciones.GetFinalQueryAppend(finalQueryGlobal, sFinalQuery); finalQueryGlobal=Funciones.GetFinalQueryAppend(finalQueryGlobal, ""); finalQueryGlobal+=LineaConstantesFunciones.SFINALQUERY; this.cargarCombosLineaGruposForeignKeyLista(finalQueryGlobal); } } catch(Exception e) { throw e; } } public void cargarCombosForeignKeyLineaCategoriaListas(Boolean cargarCombosDependencia,String sFinalQuery)throws Exception { try { ArrayList<String> arrColumnasGlobales=new ArrayList<String>(); String finalQueryGlobal=""; Modulo moduloActualAux=new Modulo(); if((this.lineacategoriasForeignKey==null||this.lineacategoriasForeignKey.size()<=0)) { this.arrDatoGeneral= new ArrayList<DatoGeneral>(); this.arrDatoGeneralNo= new ArrayList<String>(); arrColumnasGlobales=LineaConstantesFunciones.getArrayColumnasGlobalesLinea(this.arrDatoGeneral,this.arrDatoGeneralNo); finalQueryGlobal=Funciones.GetWhereGlobalConstants(this.parametroGeneralUsuario,this.moduloActual,true,false,arrColumnasGlobales,LineaConstantesFunciones.TABLENAME); finalQueryGlobal=Funciones.GetFinalQueryAppend(finalQueryGlobal, sFinalQuery); finalQueryGlobal=Funciones.GetFinalQueryAppend(finalQueryGlobal, ""); finalQueryGlobal+=LineaConstantesFunciones.SFINALQUERY; this.cargarCombosLineaCategoriasForeignKeyLista(finalQueryGlobal); } } catch(Exception e) { throw e; } } public void cargarCombosForeignKeyLineaMarcaListas(Boolean cargarCombosDependencia,String sFinalQuery)throws Exception { try { ArrayList<String> arrColumnasGlobales=new ArrayList<String>(); String finalQueryGlobal=""; Modulo moduloActualAux=new Modulo(); if((this.lineamarcasForeignKey==null||this.lineamarcasForeignKey.size()<=0)) { this.arrDatoGeneral= new ArrayList<DatoGeneral>(); this.arrDatoGeneralNo= new ArrayList<String>(); arrColumnasGlobales=LineaConstantesFunciones.getArrayColumnasGlobalesLinea(this.arrDatoGeneral,this.arrDatoGeneralNo); finalQueryGlobal=Funciones.GetWhereGlobalConstants(this.parametroGeneralUsuario,this.moduloActual,true,false,arrColumnasGlobales,LineaConstantesFunciones.TABLENAME); finalQueryGlobal=Funciones.GetFinalQueryAppend(finalQueryGlobal, sFinalQuery); finalQueryGlobal=Funciones.GetFinalQueryAppend(finalQueryGlobal, ""); finalQueryGlobal+=LineaConstantesFunciones.SFINALQUERY; this.cargarCombosLineaMarcasForeignKeyLista(finalQueryGlobal); } } catch(Exception e) { throw e; } } public void addItemDefectoCombosTodosForeignKeyProcesoPreciosPorcentaje()throws Exception { try { this.addItemDefectoCombosForeignKeyBodega(); this.addItemDefectoCombosForeignKeyProducto(); this.addItemDefectoCombosForeignKeyEmpresa(); this.addItemDefectoCombosForeignKeySucursal(); this.addItemDefectoCombosForeignKeyLinea(); this.addItemDefectoCombosForeignKeyLineaGrupo(); this.addItemDefectoCombosForeignKeyLineaCategoria(); this.addItemDefectoCombosForeignKeyLineaMarca(); } catch(Exception e) { throw e; } } public void addItemDefectoCombosForeignKeyBodega()throws Exception { try { if(this.procesopreciosporcentajeSessionBean==null) { this.procesopreciosporcentajeSessionBean=new ProcesoPreciosPorcentajeSessionBean(); } if(!this.procesopreciosporcentajeSessionBean.getisBusquedaDesdeForeignKeySesionBodega()) { Bodega bodega=new Bodega(); BodegaConstantesFunciones.setBodegaDescripcion(bodega,Constantes.SMENSAJE_ESCOJA_OPCION); bodega.setId(null); if(!BodegaConstantesFunciones.ExisteEnLista(this.bodegasForeignKey,bodega,true)) { this.bodegasForeignKey.add(0,bodega); } } } catch(Exception e) { throw e; } } public void addItemDefectoCombosForeignKeyProducto()throws Exception { try { if(!this.procesopreciosporcentajeSessionBean.getisBusquedaDesdeForeignKeySesionProducto()) { Producto producto=new Producto(); ProductoConstantesFunciones.setProductoDescripcion(producto,Constantes.SMENSAJE_ESCOJA_OPCION); producto.setId(null); if(!ProductoConstantesFunciones.ExisteEnLista(this.productosForeignKey,producto,true)) { this.productosForeignKey.add(0,producto); } } } catch(Exception e) { throw e; } } public void addItemDefectoCombosForeignKeyEmpresa()throws Exception { try { if(!this.procesopreciosporcentajeSessionBean.getisBusquedaDesdeForeignKeySesionEmpresa()) { Empresa empresa=new Empresa(); EmpresaConstantesFunciones.setEmpresaDescripcion(empresa,Constantes.SMENSAJE_ESCOJA_OPCION); empresa.setId(null); if(!EmpresaConstantesFunciones.ExisteEnLista(this.empresasForeignKey,empresa,true)) { this.empresasForeignKey.add(0,empresa); } } } catch(Exception e) { throw e; } } public void addItemDefectoCombosForeignKeySucursal()throws Exception { try { if(!this.procesopreciosporcentajeSessionBean.getisBusquedaDesdeForeignKeySesionSucursal()) { Sucursal sucursal=new Sucursal(); SucursalConstantesFunciones.setSucursalDescripcion(sucursal,Constantes.SMENSAJE_ESCOJA_OPCION); sucursal.setId(null); if(!SucursalConstantesFunciones.ExisteEnLista(this.sucursalsForeignKey,sucursal,true)) { this.sucursalsForeignKey.add(0,sucursal); } } } catch(Exception e) { throw e; } } public void addItemDefectoCombosForeignKeyLinea()throws Exception { try { if(!this.procesopreciosporcentajeSessionBean.getisBusquedaDesdeForeignKeySesionLinea()) { Linea linea=new Linea(); LineaConstantesFunciones.setLineaDescripcion(linea,Constantes.SMENSAJE_ESCOJA_OPCION); linea.setId(null); if(!LineaConstantesFunciones.ExisteEnLista(this.lineasForeignKey,linea,true)) { this.lineasForeignKey.add(0,linea); } } } catch(Exception e) { throw e; } } public void addItemDefectoCombosForeignKeyLineaGrupo()throws Exception { try { if(!this.procesopreciosporcentajeSessionBean.getisBusquedaDesdeForeignKeySesionLineaGrupo()) { Linea lineagrupo=new Linea(); LineaConstantesFunciones.setLineaDescripcion(lineagrupo,Constantes.SMENSAJE_ESCOJA_OPCION); lineagrupo.setId(null); if(!LineaConstantesFunciones.ExisteEnLista(this.lineagruposForeignKey,lineagrupo,true)) { this.lineagruposForeignKey.add(0,lineagrupo); } } } catch(Exception e) { throw e; } } public void addItemDefectoCombosForeignKeyLineaCategoria()throws Exception { try { if(!this.procesopreciosporcentajeSessionBean.getisBusquedaDesdeForeignKeySesionLineaCategoria()) { Linea lineacategoria=new Linea(); LineaConstantesFunciones.setLineaDescripcion(lineacategoria,Constantes.SMENSAJE_ESCOJA_OPCION); lineacategoria.setId(null); if(!LineaConstantesFunciones.ExisteEnLista(this.lineacategoriasForeignKey,lineacategoria,true)) { this.lineacategoriasForeignKey.add(0,lineacategoria); } } } catch(Exception e) { throw e; } } public void addItemDefectoCombosForeignKeyLineaMarca()throws Exception { try { if(!this.procesopreciosporcentajeSessionBean.getisBusquedaDesdeForeignKeySesionLineaMarca()) { Linea lineamarca=new Linea(); LineaConstantesFunciones.setLineaDescripcion(lineamarca,Constantes.SMENSAJE_ESCOJA_OPCION); lineamarca.setId(null); if(!LineaConstantesFunciones.ExisteEnLista(this.lineamarcasForeignKey,lineamarca,true)) { this.lineamarcasForeignKey.add(0,lineamarca); } } } catch(Exception e) { throw e; } } public void initActionsCombosTodosForeignKeyProcesoPreciosPorcentaje()throws Exception { try { } catch(Exception e) { throw e; } } public void initActionsCombosTodosForeignKeyProcesoPreciosPorcentaje(String sFormularioTipoBusqueda)throws Exception { try { } catch(Exception e) { throw e; } } public void setVariablesGlobalesCombosForeignKeyProcesoPreciosPorcentaje()throws Exception { try { if(this.parametroGeneralUsuario!=null && this.parametroGeneralUsuario.getId()>0) { } //INICIALIZA VARIABLES COMBOS GLOBALES AUXILIARES A FORMULARIO(Anio,Mes) this.setVariablesGlobalesAuxiliaresCombosForeignKeyProcesoPreciosPorcentaje(); } catch(Exception e) { throw e; } } public void setVariablesObjetoActualToFormularioForeignKeyProcesoPreciosPorcentaje(ProcesoPreciosPorcentaje procesopreciosporcentaje)throws Exception { try { } catch(Exception e) { throw e; } } public void setVariablesObjetoActualToListasForeignKeyProcesoPreciosPorcentaje(ProcesoPreciosPorcentaje procesopreciosporcentaje,String sTipoEvento)throws Exception { try { } catch(Exception e) { throw e; } } /* public void setVariablesCombosFromBeanForeignKeyProcesoPreciosPorcentaje()throws Exception { try { } catch(Exception e) { throw e; } } */ public void setVariablesGlobalesAuxiliaresCombosForeignKeyProcesoPreciosPorcentaje()throws Exception { try { } catch(Exception e) { throw e; } } public void setVariablesDefaultCombosForeignKeyProcesoPreciosPorcentaje()throws Exception { try { } catch(Exception e) { throw e; } } public void setVariablesParametroCombosForeignKeyProcesoPreciosPorcentaje()throws Exception { try { } catch(Exception e) { throw e; } } public void cargarCombosParametroProcesoPreciosPorcentaje()throws Exception { try { ArrayList<String> arrColumnasGlobales=new ArrayList<String>(); String finalQueryGlobal=""; //this.cargarDatosCliente(); } catch(Exception e) { throw e; } } public void cargarCombosFrameForeignKeyProcesoPreciosPorcentaje()throws Exception { try { this.cargarCombosFrameBodegasForeignKey("Todos"); this.cargarCombosFrameProductosForeignKey("Todos"); this.cargarCombosFrameEmpresasForeignKey("Todos"); this.cargarCombosFrameSucursalsForeignKey("Todos"); this.cargarCombosFrameLineasForeignKey("Todos"); this.cargarCombosFrameLineaGruposForeignKey("Todos"); this.cargarCombosFrameLineaCategoriasForeignKey("Todos"); this.cargarCombosFrameLineaMarcasForeignKey("Todos"); } catch(Exception e) { throw e; } } public void cargarCombosFrameForeignKeyProcesoPreciosPorcentaje(String sFormularioTipoBusqueda)throws Exception { try { this.cargarCombosFrameBodegasForeignKey(sFormularioTipoBusqueda); this.cargarCombosFrameProductosForeignKey(sFormularioTipoBusqueda); this.cargarCombosFrameEmpresasForeignKey(sFormularioTipoBusqueda); this.cargarCombosFrameSucursalsForeignKey(sFormularioTipoBusqueda); this.cargarCombosFrameLineasForeignKey(sFormularioTipoBusqueda); this.cargarCombosFrameLineaGruposForeignKey(sFormularioTipoBusqueda); this.cargarCombosFrameLineaCategoriasForeignKey(sFormularioTipoBusqueda); this.cargarCombosFrameLineaMarcasForeignKey(sFormularioTipoBusqueda); } catch(Exception e) { throw e; } } public void setItemDefectoCombosForeignKeyProcesoPreciosPorcentaje()throws Exception { try { if(this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jComboBoxid_bodegaProcesoPreciosPorcentaje!=null && this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jComboBoxid_bodegaProcesoPreciosPorcentaje.getItemCount()>0) { this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jComboBoxid_bodegaProcesoPreciosPorcentaje.setSelectedIndex(0); } if(this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jComboBoxid_productoProcesoPreciosPorcentaje!=null && this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jComboBoxid_productoProcesoPreciosPorcentaje.getItemCount()>0) { this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jComboBoxid_productoProcesoPreciosPorcentaje.setSelectedIndex(0); } if(this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jComboBoxid_empresaProcesoPreciosPorcentaje!=null && this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jComboBoxid_empresaProcesoPreciosPorcentaje.getItemCount()>0) { this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jComboBoxid_empresaProcesoPreciosPorcentaje.setSelectedIndex(0); } if(this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jComboBoxid_sucursalProcesoPreciosPorcentaje!=null && this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jComboBoxid_sucursalProcesoPreciosPorcentaje.getItemCount()>0) { this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jComboBoxid_sucursalProcesoPreciosPorcentaje.setSelectedIndex(0); } if(this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jComboBoxid_lineaProcesoPreciosPorcentaje!=null && this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jComboBoxid_lineaProcesoPreciosPorcentaje.getItemCount()>0) { this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jComboBoxid_lineaProcesoPreciosPorcentaje.setSelectedIndex(0); } if(this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jComboBoxid_linea_grupoProcesoPreciosPorcentaje!=null && this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jComboBoxid_linea_grupoProcesoPreciosPorcentaje.getItemCount()>0) { this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jComboBoxid_linea_grupoProcesoPreciosPorcentaje.setSelectedIndex(0); } if(this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jComboBoxid_linea_categoriaProcesoPreciosPorcentaje!=null && this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jComboBoxid_linea_categoriaProcesoPreciosPorcentaje.getItemCount()>0) { this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jComboBoxid_linea_categoriaProcesoPreciosPorcentaje.setSelectedIndex(0); } if(this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jComboBoxid_linea_marcaProcesoPreciosPorcentaje!=null && this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jComboBoxid_linea_marcaProcesoPreciosPorcentaje.getItemCount()>0) { this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jComboBoxid_linea_marcaProcesoPreciosPorcentaje.setSelectedIndex(0); } } catch(Exception e) { throw e; } } public ProcesoPreciosPorcentajeBeanSwingJInternalFrame() throws Exception { super(false,PaginaTipo.PRINCIPAL); } public ProcesoPreciosPorcentajeBeanSwingJInternalFrame(Boolean cargarRelaciones,PaginaTipo paginaTipo) throws Exception { super(cargarRelaciones,paginaTipo); } public ProcesoPreciosPorcentajeBeanSwingJInternalFrame(Boolean conGuardarRelaciones,Boolean esGuardarRelacionado,Boolean cargarRelaciones,PaginaTipo paginaTipo) throws Exception { super(cargarRelaciones,paginaTipo); this.procesopreciosporcentajeSessionBean=new ProcesoPreciosPorcentajeSessionBean(); this.procesopreciosporcentajeConstantesFunciones=new ProcesoPreciosPorcentajeConstantesFunciones(); this.procesopreciosporcentajeBean=new ProcesoPreciosPorcentaje();//(this.procesopreciosporcentajeConstantesFunciones); this.procesopreciosporcentajeReturnGeneral=new ProcesoPreciosPorcentajeParameterReturnGeneral(); this.procesopreciosporcentajeSessionBean.setConGuardarRelaciones(conGuardarRelaciones); this.procesopreciosporcentajeSessionBean.setEsGuardarRelacionado(esGuardarRelacionado); } public ProcesoPreciosPorcentajeBeanSwingJInternalFrame(Boolean blncargarCombostrForeignKey,Boolean blnCargarInformacionInicial,JDesktopPane jdesktopPane,Usuario usuarioActual,ResumenUsuario resumenUsuarioActual,Modulo moduloActual,Opcion opcionActual,ParametroGeneralSg parametroGeneralSg,ParametroGeneralUsuario parametroGeneralUsuario,Boolean conGuardarRelaciones,Boolean esGuardarRelacionado,Boolean cargarRelaciones,Boolean cargarTodosDatos,PaginaTipo paginaTipo) throws Exception { this(blncargarCombostrForeignKey,blnCargarInformacionInicial,jdesktopPane,usuarioActual,resumenUsuarioActual,moduloActual,opcionActual,parametroGeneralSg,parametroGeneralUsuario,paginaTipo,conGuardarRelaciones,esGuardarRelacionado,cargarRelaciones,cargarTodosDatos); } public ProcesoPreciosPorcentajeBeanSwingJInternalFrame(Boolean blncargarCombostrForeignKey,Boolean blnCargarInformacionInicial,JDesktopPane jdesktopPane,Usuario usuarioActual,ResumenUsuario resumenUsuarioActual,Modulo moduloActual,Opcion opcionActual,ParametroGeneralSg parametroGeneralSg,ParametroGeneralUsuario parametroGeneralUsuario,Boolean cargarRelaciones,Boolean cargarTodosDatos,PaginaTipo paginaTipo) throws Exception { this(blncargarCombostrForeignKey,blnCargarInformacionInicial,jdesktopPane,usuarioActual,resumenUsuarioActual,moduloActual,opcionActual,parametroGeneralSg,parametroGeneralUsuario,paginaTipo,false,false,cargarRelaciones,cargarTodosDatos); } public ProcesoPreciosPorcentajeBeanSwingJInternalFrame(Boolean blncargarCombostrForeignKey,Boolean blnCargarInformacionInicial,JDesktopPane jdesktopPane,Usuario usuarioActual,ResumenUsuario resumenUsuarioActual,Modulo moduloActual,Opcion opcionActual,ParametroGeneralSg parametroGeneralSg,ParametroGeneralUsuario parametroGeneralUsuario,PaginaTipo paginaTipo,Boolean conGuardarRelaciones,Boolean esGuardarRelacionado,Boolean cargarRelaciones,Boolean cargarTodosDatos) throws Exception //Boolean esParaBusquedaForeignKey { super(jdesktopPane,conGuardarRelaciones,esGuardarRelacionado,cargarRelaciones,usuarioActual,resumenUsuarioActual,moduloActual,opcionActual,parametroGeneralSg,parametroGeneralUsuario,paginaTipo); try { this.permiteRecargarForm=false; this.startProcessProcesoPreciosPorcentaje(true); Boolean esParaBusquedaForeignKey=false;//ANTES USADO COMO PARAMETRO DEL CONSTRUCTOR if(paginaTipo.equals(PaginaTipo.BUSQUEDA)) { esParaBusquedaForeignKey=true; } //SE ASIGNA EN CLASE PADRE /* this.parametroGeneralSg=parametroGeneralSg; this.parametroGeneralUsuario=parametroGeneralUsuario; this.usuarioActual=usuarioActual; this.moduloActual=moduloActual; */ long start_time=0; long end_time=0; if(Constantes2.ISDEVELOPING2) { start_time = System.currentTimeMillis(); } if(!cargarTodosDatos) { this.sAccionBusqueda="NINGUNO"; } this.procesopreciosporcentajeConstantesFunciones=new ProcesoPreciosPorcentajeConstantesFunciones(); this.procesopreciosporcentajeBean=new ProcesoPreciosPorcentaje();//this.procesopreciosporcentajeConstantesFunciones); this.procesopreciosporcentajeReturnGeneral=new ProcesoPreciosPorcentajeParameterReturnGeneral(); ProcesoPreciosPorcentajeBeanSwingJInternalFrameAdditional.CargaInicialInicio(this, "NORMAL", null); this.setTitle(Funciones.GetTituloSistema(this.parametroGeneralSg,this.moduloActual,this.usuarioActual,"Proceso Precios Porcentaje Mantenimiento",paginaTipo)); this.conTotales=false; this.conTotales=true; this.procesopreciosporcentaje=new ProcesoPreciosPorcentaje(); this.procesopreciosporcentajes = new ArrayList<ProcesoPreciosPorcentaje>(); this.procesopreciosporcentajesAux = new ArrayList<ProcesoPreciosPorcentaje>(); if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic=new ProcesoPreciosPorcentajeLogic(); this.procesopreciosporcentajeLogic.getNewConnexionToDeep(""); } //this.procesopreciosporcentajeSessionBean.setConGuardarRelaciones(conGuardarRelaciones); //this.procesopreciosporcentajeSessionBean.setEsGuardarRelacionado(esGuardarRelacionado); this.jDesktopPane=jdesktopPane; if(this.jDesktopPane.getClass().equals(JDesktopPaneMe.class)) { this.constantes2=((JDesktopPaneMe)this.jDesktopPane).constantes2; } if(!Constantes.CON_VARIAS_VENTANAS) { MainJFrame.cerrarJInternalFramesExistentes(this.jDesktopPane,this.jInternalFrameDetalleFormProcesoPreciosPorcentaje); if(!this.conCargarMinimo) { if(this.jInternalFrameReporteDinamicoProcesoPreciosPorcentaje!=null) { MainJFrame.cerrarJInternalFramesExistentes(this.jDesktopPane,this.jInternalFrameReporteDinamicoProcesoPreciosPorcentaje); } if(this.jInternalFrameImportacionProcesoPreciosPorcentaje!=null) { MainJFrame.cerrarJInternalFramesExistentes(this.jDesktopPane,this.jInternalFrameImportacionProcesoPreciosPorcentaje); } } if(!this.conCargarMinimo) { if(this.jInternalFrameOrderByProcesoPreciosPorcentaje!=null) { MainJFrame.cerrarJInternalFramesExistentes(this.jDesktopPane,this.jInternalFrameOrderByProcesoPreciosPorcentaje); } } } //DETALLE DATOS if(this.jInternalFrameDetalleFormProcesoPreciosPorcentaje!=null) { //this.conCargarFormDetalle) { this.jDesktopPane.add(this.jInternalFrameDetalleFormProcesoPreciosPorcentaje); this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.setVisible(false); this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.setSelected(false); } if(!this.conCargarMinimo) { //REPORTE DINAMICO if(this.jInternalFrameReporteDinamicoProcesoPreciosPorcentaje!=null) { this.jDesktopPane.add(this.jInternalFrameReporteDinamicoProcesoPreciosPorcentaje); this.jInternalFrameReporteDinamicoProcesoPreciosPorcentaje.setVisible(false); this.jInternalFrameReporteDinamicoProcesoPreciosPorcentaje.setSelected(false); } //IMPORTACION if(this.jInternalFrameImportacionProcesoPreciosPorcentaje!=null) { this.jDesktopPane.add(this.jInternalFrameImportacionProcesoPreciosPorcentaje); this.jInternalFrameImportacionProcesoPreciosPorcentaje.setVisible(false); this.jInternalFrameImportacionProcesoPreciosPorcentaje.setSelected(false); } } if(!this.conCargarMinimo) { if(this.jInternalFrameOrderByProcesoPreciosPorcentaje!=null) { this.jDesktopPane.add(this.jInternalFrameOrderByProcesoPreciosPorcentaje); this.jInternalFrameOrderByProcesoPreciosPorcentaje.setVisible(false); this.jInternalFrameOrderByProcesoPreciosPorcentaje.setSelected(false); } } //this.esParaBusquedaForeignKey=false; this.esParaBusquedaForeignKey=esParaBusquedaForeignKey; this.invalidValues=new InvalidValue[0]; this.idProcesoPreciosPorcentajeActual=0L; this.rowIndexActual=0; this.iNumeroPaginacionPagina=0; this.iNumeroPaginacion=ProcesoPreciosPorcentajeConstantesFunciones.INUMEROPAGINACION; this.pagination=new Pagination(); this.datosCliente=new DatosCliente(); this.lIdUsuarioSesion=0L; this.sTipoArchivoReporte=""; this.sTipoArchivoReporteDinamico=""; this.sTipoReporte=""; this.sTipoReporteDinamico=""; this.sTipoPaginacion=""; this.sTipoRelacion=""; this.sTipoAccion=""; this.sTipoAccionFormulario=""; this.sTipoSeleccionar=""; this.sDetalleReporte=""; this.sTipoReporteExtra=""; this.sValorCampoGeneral=""; this.sPathReporteDinamico=""; this.isMostrarNumeroPaginacion=false; this.isSeleccionarTodos=false; this.isSeleccionados=false; this.conGraficoReporte=false; this.isPostAccionNuevo=false; this.isPostAccionSinCerrar=false; this.isPostAccionSinMensaje=false; this.esReporteDinamico=false; this.esRecargarFks=false; this.esReporteAccionProceso=false; this.procesopreciosporcentajeReturnGeneral=new ProcesoPreciosPorcentajeParameterReturnGeneral(); this.procesopreciosporcentajeParameterGeneral=new ProcesoPreciosPorcentajeParameterReturnGeneral(); this.sistemaLogicAdditional=new SistemaLogicAdditional(); this.sistemaLogicAdditional.setConnexion(this.procesopreciosporcentajeLogic.getConnexion()); //VERIFICAR GLOBAL this.cargarDatosCliente(); if(!this.procesopreciosporcentajeSessionBean.getEsGuardarRelacionado()) { if(Constantes.ISUSAEJBLOGICLAYER) { if(!sistemaLogicAdditional.validarLicenciaCliente(this.datosCliente,this.moduloActual,this.usuarioActual)) { this.setVisible(false); throw new Exception(Mensajes.SERROR_CONTROLGLOBAL); } } else if(Constantes.ISUSAEJBREMOTE) { } else if(Constantes.ISUSAEJBHOME) { } } //VERIFICAR GLOBAL //VERIFICAR SESSION ACTUAL //this.cargarDatosCliente(); this.sistemaReturnGeneral=new SistemaParameterReturnGeneral(); SistemaParameterReturnGeneralAdditional.inicializarSinSeguridad(this.sistemaReturnGeneral); if(ProcesoPreciosPorcentajeJInternalFrame.CON_LLAMADA_SIMPLE) { if(this.procesopreciosporcentajeSessionBean.getEsGuardarRelacionado()) { this.opcionActual.setId(0L); //idOpcion=0L; } ArrayList<String> arrPaginas=new ArrayList<String>(); ArrayList<Opcion> opcionsFinal=new ArrayList<Opcion>(); if(Constantes.ISUSAEJBLOGICLAYER) { //this.sistemaReturnGeneral=sistemaLogicAdditional.validarCargarSesionUsuarioActualWithConnection(this.usuarioActual,this.datosCliente,this.resumenUsuarioActual,Constantes.LIDSISTEMAACTUAL,ProcesoPreciosPorcentajeConstantesFunciones.SNOMBREOPCION,this.opcionActual,this.procesopreciosporcentajeSessionBean.getEsGuardarRelacionado(),this.procesopreciosporcentajeSessionBean.getConGuardarRelaciones(),arrPaginas); this.sistemaReturnGeneral=sistemaLogicAdditional.validarCargarSesionUsuarioActual(this.usuarioActual,this.datosCliente,this.resumenUsuarioActual,Constantes.LIDSISTEMAACTUAL,ProcesoPreciosPorcentajeConstantesFunciones.SNOMBREOPCION,this.opcionActual,this.procesopreciosporcentajeSessionBean.getEsGuardarRelacionado(),this.procesopreciosporcentajeSessionBean.getConGuardarRelaciones(),arrPaginas); if(!this.sistemaReturnGeneral.getEsValidado()) { this.setVisible(false); throw new Exception(Mensajes.SERROR_SESIONACTUAL); } } else if(Constantes.ISUSAEJBREMOTE) { } else if(Constantes.ISUSAEJBHOME) { //FALTA } } else { if(Constantes.ISUSAEJBLOGICLAYER) { if(!sistemaLogicAdditional.validarSesionUsuarioActual(this.usuarioActual,this.datosCliente,this.resumenUsuarioActual)) { this.setVisible(false); throw new Exception(Mensajes.SERROR_SESIONACTUAL); } } else if(Constantes.ISUSAEJBREMOTE) { } else if(Constantes.ISUSAEJBHOME) { } } //VERIFICAR SESSION ACTUAL this.sVisibilidadTablaBusquedas="table-row"; this.sVisibilidadTablaElementos="none"; this.sVisibilidadTablaAcciones="none"; this.isVisibilidadCeldaNuevoProcesoPreciosPorcentaje=false; this.isVisibilidadCeldaDuplicarProcesoPreciosPorcentaje=true; this.isVisibilidadCeldaCopiarProcesoPreciosPorcentaje=true; this.isVisibilidadCeldaVerFormProcesoPreciosPorcentaje=true; this.isVisibilidadCeldaOrdenProcesoPreciosPorcentaje=true; this.isVisibilidadCeldaNuevoRelacionesProcesoPreciosPorcentaje=false; this.isVisibilidadCeldaModificarProcesoPreciosPorcentaje=false; this.isVisibilidadCeldaActualizarProcesoPreciosPorcentaje=false; this.isVisibilidadCeldaEliminarProcesoPreciosPorcentaje=false; this.isVisibilidadCeldaCancelarProcesoPreciosPorcentaje=false; this.isVisibilidadCeldaGuardarProcesoPreciosPorcentaje=false; this.isVisibilidadCeldaGuardarCambiosProcesoPreciosPorcentaje=false; this.isVisibilidadBusquedaProcesoPreciosPorcentaje=true; this.isVisibilidadFK_IdBodega=true; this.isVisibilidadFK_IdEmpresa=true; this.isVisibilidadFK_IdLinea=true; this.isVisibilidadFK_IdLineaCategoria=true; this.isVisibilidadFK_IdLineaGrupo=true; this.isVisibilidadFK_IdLineaMarca=true; this.isVisibilidadFK_IdProducto=true; this.isVisibilidadFK_IdSucursal=true; //ELEMENTOS TABLAS PARAMETOS //ELEMENTOS TABLAS PARAMETOS_FIN //this.actualizarEstadoCeldasBotonesProcesoPreciosPorcentaje("n", isGuardarCambiosEnLote, isEsMantenimientoRelacionado); this.inicializarPermisosProcesoPreciosPorcentaje(); //INICIALIZAR FALSE, TALVEZ COMENTAR this.setPermisosUsuarioProcesoPreciosPorcentaje(false); this.setPermisosUsuarioProcesoPreciosPorcentaje(); //FUNCIONALIDAD_RELACIONADO if(!this.procesopreciosporcentajeSessionBean.getEsGuardarRelacionado() || (this.procesopreciosporcentajeSessionBean.getEsGuardarRelacionado() && this.procesopreciosporcentajeSessionBean.getConGuardarRelaciones())) { this.inicializarSetPermisosUsuarioProcesoPreciosPorcentajeClasesRelacionadas(); } if(this.procesopreciosporcentajeSessionBean.getConGuardarRelaciones()) { this.actualizarTabsSetPermisosUsuarioProcesoPreciosPorcentajeClasesRelacionadas(); } //SOLO SE EJECUTA LA PRIMERA VEZ, BINDINGS SI FUNCIONA if(!ProcesoPreciosPorcentajeJInternalFrame.ISBINDING_MANUAL) { this.inicializarActualizarBindingBotonesPermisosProcesoPreciosPorcentaje(); } else { this.inicializarActualizarBindingBotonesPermisosManualProcesoPreciosPorcentaje(); } if(!this.isPermisoBusquedaProcesoPreciosPorcentaje) { //BYDAN_BUSQUEDAS this.jTabbedPaneBusquedasProcesoPreciosPorcentaje.setVisible(false); } //FUNCIONALIDAD_RELACIONADO if(!this.procesopreciosporcentajeSessionBean.getEsGuardarRelacionado()) { this.tiposArchivosReportes=Funciones.getListTiposArchivosReportes(); this.tiposArchivosReportesDinamico=Funciones.getListTiposArchivosReportes(); this.tiposReportes=Funciones.getListTiposReportes(true); this.tiposReportesDinamico=Funciones.getListTiposReportesDinamico(true); this.tiposGraficosReportes=Funciones2.getListTiposGraficosReportes(); this.tiposPaginacion=Funciones2.getListTiposPaginacion(true,true,true); this.tiposSeleccionar=Funciones2.getListTiposSeleccionar(); this.tiposSeleccionar.addAll(ProcesoPreciosPorcentajeConstantesFunciones.getTiposSeleccionarProcesoPreciosPorcentaje()); this.tiposColumnasSelect=ProcesoPreciosPorcentajeConstantesFunciones.getTiposSeleccionarProcesoPreciosPorcentaje(true); this.tiposRelacionesSelect=new ArrayList<Reporte>(); } else { this.tiposArchivosReportes=new ArrayList<Reporte>(); this.tiposArchivosReportesDinamico=new ArrayList<Reporte>(); this.tiposReportes=new ArrayList<Reporte>(); this.tiposReportesDinamico=new ArrayList<Reporte>(); this.tiposGraficosReportes=new ArrayList<Reporte>(); this.tiposPaginacion=new ArrayList<Reporte>(); this.tiposSeleccionar=new ArrayList<Reporte>(); this.tiposColumnasSelect=new ArrayList<Reporte>(); this.tiposRelacionesSelect=new ArrayList<Reporte>(); } //FUNCIONALIDAD_RELACIONADO //if(!this.procesopreciosporcentajeSessionBean.getEsGuardarRelacionado()) { //SE ENCUENTRA MAS ADELANTE CON ACCIONES POR USUARIO //ACCIONES GENERALES Y POR USUARIO this.tiposRelaciones=Funciones2.getListTiposRelaciones(); this.setRelacionesUsuarioProcesoPreciosPorcentaje(); this.tiposAcciones=Funciones2.getListTiposAcciones(true,false,false); this.setAccionesUsuarioProcesoPreciosPorcentaje(false); this.tiposAccionesFormulario=Funciones2.getListTiposAccionesFormulario(true,false,false); this.setAccionesUsuarioProcesoPreciosPorcentaje(true); this.inicializarActualizarBindingtiposArchivosReportesAccionesProcesoPreciosPorcentaje() ; /* } else { this.tiposAcciones=new ArrayList<Reporte>(); this.tiposAccionesFormulario=new ArrayList<Reporte>(); } */ this.inicializarInvalidValues(); this.arrDatoGeneral= new ArrayList<DatoGeneral>(); this.arrDatoGeneralNo= new ArrayList<String>(); this.arrOrderBy= new ArrayList<OrderBy>(); this.arrDatoGeneralMinimos= new ArrayList<DatoGeneralMinimo>(); this.traerValoresTablaOrderBy(); this.isGuardarCambiosEnLote=false; this.isCargarCombosDependencia=false; jasperPrint = null; //FK this.bodegaLogic=new BodegaLogic(); this.productoLogic=new ProductoLogic(); this.empresaLogic=new EmpresaLogic(); this.sucursalLogic=new SucursalLogic(); this.lineaLogic=new LineaLogic(); this.lineagrupoLogic=new LineaLogic(); this.lineacategoriaLogic=new LineaLogic(); this.lineamarcaLogic=new LineaLogic(); //PARAMETROS /* if(Constantes.ISUSAEJBREMOTE || Constantes.ISUSAEJBHOME) { hashtableEnv = Funciones.getHashtableEnv(); initialContext = new InitialContext(hashtableEnv); } */ /* if(Constantes.ISUSAEJBREMOTE) { procesopreciosporcentajeImplementable= (ProcesoPreciosPorcentajeImplementable) initialContext.lookup(Constantes.SEJBPACKAGE+Constantes.SEJBSEPARATOR+ProcesoPreciosPorcentajeConstantesFunciones.SEJBNAME+Constantes.SEJBSEPARATOR+Constantes.SEJBREMOTE); } else if(Constantes.ISUSAEJBHOME) { procesopreciosporcentajeImplementableHome= (ProcesoPreciosPorcentajeImplementableHome) initialContext.lookup(Constantes.SEJBPACKAGE+Constantes.SEJBSEPARATOR+ProcesoPreciosPorcentajeConstantesFunciones.SEJBNAME+Constantes.SEJBSEPARATOR+Constantes.SEJBLOCAL); } */ this.procesopreciosporcentajes= new ArrayList<ProcesoPreciosPorcentaje>(); this.procesopreciosporcentajesEliminados= new ArrayList<ProcesoPreciosPorcentaje>(); this.isEsNuevoProcesoPreciosPorcentaje=false; this.esParaAccionDesdeFormularioProcesoPreciosPorcentaje=false; this.isEsMantenimientoRelacionesRelacionadoUnico=false; this.isEsMantenimientoRelaciones=false; this.isEsMantenimientoRelacionado=false; this.isContieneImagenes=false; //INICIALIZAR LISTAS FK this.bodegasForeignKey=new ArrayList<Bodega>() ; this.productosForeignKey=new ArrayList<Producto>() ; this.empresasForeignKey=new ArrayList<Empresa>() ; this.sucursalsForeignKey=new ArrayList<Sucursal>() ; this.lineasForeignKey=new ArrayList<Linea>() ; this.lineagruposForeignKey=new ArrayList<Linea>() ; this.lineacategoriasForeignKey=new ArrayList<Linea>() ; this.lineamarcasForeignKey=new ArrayList<Linea>() ; if(blncargarCombostrForeignKey) { this.cargarCombosForeignKeyProcesoPreciosPorcentaje(this.isCargarCombosDependencia); } this.cargarCombosParametroProcesoPreciosPorcentaje(); //FUNCIONALIDAD_RELACIONADO if(!this.procesopreciosporcentajeSessionBean.getEsGuardarRelacionado()) { this.onLoad(); } ProcesoPreciosPorcentajeBeanSwingJInternalFrameAdditional.RecargarVentanaSegunOpcion(this,opcionActual); /* if(blnCargarInformacionInicial) { this.recargarInformacion(); } */ //this.iNumeroPaginacionPagina=0; //this.iNumeroPaginacion=ProcesoPreciosPorcentajeConstantesFunciones.INUMEROPAGINACION; this.actualizarEstadoCeldasBotonesProcesoPreciosPorcentaje("n", isGuardarCambiosEnLote, isEsMantenimientoRelacionado); //SOLO LA PRIMERA VEZ HACE LOS BINDINGS, SOLO AHI FUNCIONA this.inicializarActualizarBindingProcesoPreciosPorcentaje(true); //SE REDIMENSIONA SINO NO SE ACTUALIZA this.redimensionarTablaDatos(); this.initActions(); ; if(this.jInternalFrameDetalleFormProcesoPreciosPorcentaje!=null) {//if(this.conCargarFormDetalle) { this.cargarMenuRelaciones(); } //OBLIGA CARGAR DETALLE, MEJOR DESHABILITAR, FALTA TALVEZ PONER EN SELECCIONAR //MAYBE //this.updateControlesFormularioProcesoPreciosPorcentaje(); if(!this.conCargarMinimo) { this.updateBusquedasFormularioProcesoPreciosPorcentaje(); } ProcesoPreciosPorcentajeBeanSwingJInternalFrameAdditional.CargaInicial(this, "NORMAL", null); //SE REALIZA ESTO PARA QUE SE PUEDA RECORRER TAB SIN IMPORTAR ORDEN Boolean existeTabBusqueda=false; if(!this.conCargarMinimo) { //BYDAN_BUSQUEDAS for(int i=0; i<this.jTabbedPaneBusquedasProcesoPreciosPorcentaje.getTabCount(); i++) { this.jTabbedPaneBusquedasProcesoPreciosPorcentaje.setSelectedIndex(i); if(!existeTabBusqueda) { existeTabBusqueda=true; } } if(existeTabBusqueda) { this.jTabbedPaneBusquedasProcesoPreciosPorcentaje.setSelectedIndex(0); } } if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.commitNewConnexionToDeep(); } if(Constantes2.ISDEVELOPING2) { end_time = System.currentTimeMillis(); String sTipo="Load Ventana"; Funciones2.getMensajeTiempoEjecucion(start_time, end_time, sTipo,false); } this.finishProcessProcesoPreciosPorcentaje(true); this.dEnd=(double)System.currentTimeMillis(); this.dDif=this.dEnd - this.dStart; if(Constantes.ISDEVELOPING) { System.out.println("Tiempo(ms) Carga ProcesoPreciosPorcentaje: " + this.dDif); } this.permiteRecargarForm=true; } catch(Exception e) { if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.rollbackNewConnexionToDeep(); } FuncionesSwing.manageException(this, e,logger,ProcesoPreciosPorcentajeConstantesFunciones.CLASSNAME); } finally { if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.closeNewConnexionToDeep(); } } } public void cargarTiposRelacionesSelectProcesoPreciosPorcentaje() { Reporte reporte=new Reporte(); } public void jTabbedPaneChangeListenerGeneral(String sTipo,ChangeEvent evt) { Boolean procesaCargarParteTab=false; try { int iIndex=0; String sTitle=""; //TABBED PANE RELACIONES if(sTipo.equals("RelacionesProcesoPreciosPorcentaje")) { iIndex=this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jTabbedPaneRelacionesProcesoPreciosPorcentaje.getSelectedIndex(); sTitle=this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jTabbedPaneRelacionesProcesoPreciosPorcentaje.getTitleAt(iIndex); Integer intSelectedRow = 0; intSelectedRow = this.jTableDatosProcesoPreciosPorcentaje.getSelectedRow(); } //TABBED PANE RELACIONES FIN(EXTRA TAB) ; } catch(Exception e) { e.printStackTrace(); } finally { if(procesaCargarParteTab) { this.finishProcessProcesoPreciosPorcentaje(); } } } public void jButtonRelacionActionPerformedGeneral(String sTipo,ActionEvent evt) { try { } catch(Exception e) { e.printStackTrace(); } } public void cargarMenuRelaciones() { JMenuItem jmenuItem= new JMenuItem("General"); String sLabelMenu=""; } public void cargarCombosForeignKeyProcesoPreciosPorcentaje(Boolean cargarCombosDependencia) throws Exception { this.cargarCombosForeignKeyProcesoPreciosPorcentaje(cargarCombosDependencia,true,true); } //CARGAR COMBOS EN LOTE public void cargarCombosForeignKeyProcesoPreciosPorcentaje(Boolean cargarCombosDependencia,Boolean conInitActions,Boolean conSetVariablesGlobales) throws Exception { this.cargarCombosTodosForeignKeyProcesoPreciosPorcentajeListas(cargarCombosDependencia); this.addItemDefectoCombosTodosForeignKeyProcesoPreciosPorcentaje(); this.cargarCombosFrameForeignKeyProcesoPreciosPorcentaje(); if(conInitActions) { this.initActionsCombosTodosForeignKeyProcesoPreciosPorcentaje(); } if(conSetVariablesGlobales) { this.setVariablesGlobalesCombosForeignKeyProcesoPreciosPorcentaje(); } } public void cargarCombosForeignKeyBodega(Boolean cargarCombosDependencia,Boolean conInitActions,Boolean conSetVariablesGlobales,String sFinalQueryCombo,String sFormularioTipoBusqueda) throws Exception { try { this.cargarCombosForeignKeyBodegaListas(cargarCombosDependencia,sFinalQueryCombo); this.addItemDefectoCombosForeignKeyBodega(); this.cargarCombosFrameBodegasForeignKey(sFormularioTipoBusqueda); if(conInitActions) { } this.recargarComboTablaBodega(this.bodegasForeignKey); } catch(Exception e) { throw e; } } public void cargarCombosForeignKeyProducto(Boolean cargarCombosDependencia,Boolean conInitActions,Boolean conSetVariablesGlobales,String sFinalQueryCombo,String sFormularioTipoBusqueda) throws Exception { try { this.cargarCombosForeignKeyProductoListas(cargarCombosDependencia,sFinalQueryCombo); this.addItemDefectoCombosForeignKeyProducto(); this.cargarCombosFrameProductosForeignKey(sFormularioTipoBusqueda); if(conInitActions) { } this.recargarComboTablaProducto(this.productosForeignKey); } catch(Exception e) { throw e; } } public void cargarCombosForeignKeyLinea(Boolean cargarCombosDependencia,Boolean conInitActions,Boolean conSetVariablesGlobales,String sFinalQueryCombo,String sFormularioTipoBusqueda) throws Exception { try { this.cargarCombosForeignKeyLineaListas(cargarCombosDependencia,sFinalQueryCombo); this.addItemDefectoCombosForeignKeyLinea(); this.cargarCombosFrameLineasForeignKey(sFormularioTipoBusqueda); if(conInitActions) { } this.recargarComboTablaLinea(this.lineasForeignKey); } catch(Exception e) { throw e; } } public void cargarCombosForeignKeyLineaGrupo(Boolean cargarCombosDependencia,Boolean conInitActions,Boolean conSetVariablesGlobales,String sFinalQueryCombo,String sFormularioTipoBusqueda) throws Exception { try { this.cargarCombosForeignKeyLineaGrupoListas(cargarCombosDependencia,sFinalQueryCombo); this.addItemDefectoCombosForeignKeyLineaGrupo(); this.cargarCombosFrameLineaGruposForeignKey(sFormularioTipoBusqueda); if(conInitActions) { } this.recargarComboTablaLineaGrupo(this.lineagruposForeignKey); } catch(Exception e) { throw e; } } public void cargarCombosForeignKeyLineaCategoria(Boolean cargarCombosDependencia,Boolean conInitActions,Boolean conSetVariablesGlobales,String sFinalQueryCombo,String sFormularioTipoBusqueda) throws Exception { try { this.cargarCombosForeignKeyLineaCategoriaListas(cargarCombosDependencia,sFinalQueryCombo); this.addItemDefectoCombosForeignKeyLineaCategoria(); this.cargarCombosFrameLineaCategoriasForeignKey(sFormularioTipoBusqueda); if(conInitActions) { } this.recargarComboTablaLineaCategoria(this.lineacategoriasForeignKey); } catch(Exception e) { throw e; } } public void cargarCombosForeignKeyLineaMarca(Boolean cargarCombosDependencia,Boolean conInitActions,Boolean conSetVariablesGlobales,String sFinalQueryCombo,String sFormularioTipoBusqueda) throws Exception { try { this.cargarCombosForeignKeyLineaMarcaListas(cargarCombosDependencia,sFinalQueryCombo); this.addItemDefectoCombosForeignKeyLineaMarca(); this.cargarCombosFrameLineaMarcasForeignKey(sFormularioTipoBusqueda); if(conInitActions) { } this.recargarComboTablaLineaMarca(this.lineamarcasForeignKey); } catch(Exception e) { throw e; } } public void jButtonNuevoProcesoPreciosPorcentajeActionPerformed(ActionEvent evt,Boolean esRelaciones) throws Exception { try { EventoGlobalTipo eventoGlobalTipo=EventoGlobalTipo.FORM_RECARGAR; String sTipo="NUEVO_NORMAL"; this.estaModoNuevo=true; if(this.procesopreciosporcentajeSessionBean.getConGuardarRelaciones()) { this.dStart=(double)System.currentTimeMillis(); } //if(this.esUsoDesdeHijo) { // eventoGlobalTipo=EventoGlobalTipo.FORM_HIJO_ACTUALIZAR; //} if(this.jInternalFrameDetalleFormProcesoPreciosPorcentaje==null) { //if(!this.conCargarFormDetalle) { this.inicializarFormDetalle(); } ProcesoPreciosPorcentajeBeanSwingJInternalFrameAdditional.procesarEventosVista(this.parametroGeneralUsuario,this.moduloActual,this.opcionActual,this.usuarioActual,this,FuncionTipo.BEFORE,ControlTipo.FORM,EventoTipo.LOAD,EventoSubTipo.NEW,"FORM",this.procesopreciosporcentaje,new Object(),this.procesopreciosporcentajeParameterGeneral,this.procesopreciosporcentajeReturnGeneral); if(jTableDatosProcesoPreciosPorcentaje.getRowCount()>=1) { jTableDatosProcesoPreciosPorcentaje.removeRowSelectionInterval(0, jTableDatosProcesoPreciosPorcentaje.getRowCount()-1); } this.isEsNuevoProcesoPreciosPorcentaje=true; //ESTABLECE SI ES RELACIONADO O NO this.habilitarDeshabilitarTipoMantenimientoProcesoPreciosPorcentaje(esRelaciones); this.nuevoPreparar(false); this.habilitarDeshabilitarControlesProcesoPreciosPorcentaje(true); //this.procesopreciosporcentaje=new ProcesoPreciosPorcentaje(); //this.procesopreciosporcentaje.setIsChanged(true); //NO FUNCIONA BINDINGS this.inicializarActualizarBindingBotonesProcesoPreciosPorcentaje(false) ; //SI ES MANUAL //this.inicializarActualizarBindingBotonesManualProcesoPreciosPorcentaje() ; if(ProcesoPreciosPorcentajeJInternalFrame.CON_DATOS_FRAME) { this.abrirFrameDetalleProcesoPreciosPorcentaje(esRelaciones); } //Se Duplica, sin sentido //this.actualizarInformacion("EVENTO_NUEVO",false,this.procesopreciosporcentaje); this.actualizarInformacion("INFO_PADRE",false,this.procesopreciosporcentaje); ProcesoPreciosPorcentajeBeanSwingJInternalFrameAdditional.procesarEventosVista(this.parametroGeneralUsuario,this.moduloActual,this.opcionActual,this.usuarioActual,this,FuncionTipo.AFTER,ControlTipo.FORM,EventoTipo.LOAD,EventoSubTipo.NEW,"FORM",this.procesopreciosporcentaje,new Object(),this.procesopreciosporcentajeParameterGeneral,this.procesopreciosporcentajeReturnGeneral); if(this.procesopreciosporcentajeSessionBean.getConGuardarRelaciones()) { this.dEnd=(double)System.currentTimeMillis(); this.dDif=this.dEnd - this.dStart; if(Constantes.ISDEVELOPING) { System.out.println("Tiempo(ms) Nuevo Preparar ProcesoPreciosPorcentaje: " + this.dDif); } } //false para que pueda generar eventos this.estaModoNuevo=false; //Con this.estaModoNuevo=false;, se permite actualizar y usar eventos control al mismo tiempo (FuncionTipo.LAST) ProcesoPreciosPorcentajeBeanSwingJInternalFrameAdditional.procesarEventosVista(this.parametroGeneralUsuario,this.moduloActual,this.opcionActual,this.usuarioActual,this,FuncionTipo.LAST,ControlTipo.FORM,EventoTipo.CLIC,EventoSubTipo.NEW,sTipo,this.procesopreciosporcentaje,new Object(),this.procesopreciosporcentajeParameterGeneral,this.procesopreciosporcentajeReturnGeneral); } catch(Exception e) { FuncionesSwing.manageException(this, e,logger,ProcesoPreciosPorcentajeConstantesFunciones.CLASSNAME); } finally { this.estaModoNuevo=false; } } public void jButtonDuplicarProcesoPreciosPorcentajeActionPerformed(ActionEvent evt,Boolean esRelaciones) throws Exception { try { Boolean soloDuplicarUno=false; Boolean conSeleccionarFilaTabla=false; this.estaModoNuevo=true; this.estaModoDuplicar=true; ArrayList<ProcesoPreciosPorcentaje> procesopreciosporcentajesSeleccionados=new ArrayList<ProcesoPreciosPorcentaje>(); int intSelectedRow =-1; Integer iNumRowsSeleccionados=0; int[] arrNumRowsSeleccionados=null; //NO SE TOMA EN CUENTA, SI LOS SELECCIONADOS if(conSeleccionarFilaTabla) { arrNumRowsSeleccionados=this.jTableDatosProcesoPreciosPorcentaje.getSelectedRows(); iNumRowsSeleccionados=this.jTableDatosProcesoPreciosPorcentaje.getSelectedRows().length; } procesopreciosporcentajesSeleccionados=this.getProcesoPreciosPorcentajesSeleccionados(false); if((soloDuplicarUno && iNumRowsSeleccionados.equals(1)) || !soloDuplicarUno) { //LO HACE NUEVOPREPARAR //this.iIdNuevoProcesoPreciosPorcentaje--; //ProcesoPreciosPorcentaje procesopreciosporcentajeAux= new ProcesoPreciosPorcentaje(); //procesopreciosporcentajeAux.setId(this.iIdNuevoProcesoPreciosPorcentaje); //NO SE TOMA EN CUENTA, SI LOS SELECCIONADOS //ProcesoPreciosPorcentaje procesopreciosporcentajeOrigen=new ProcesoPreciosPorcentaje(); //for(Integer iNumRowSeleccionado:arrNumRowsSeleccionados) { for(ProcesoPreciosPorcentaje procesopreciosporcentajeOrigen : procesopreciosporcentajesSeleccionados) { if(conSeleccionarFilaTabla) { if(!soloDuplicarUno) { //NO SE TOMA EN CUENTA, SI LOS SELECCIONADOS //intSelectedRow =iNumRowSeleccionado; } else { intSelectedRow = this.jTableDatosProcesoPreciosPorcentaje.getSelectedRow(); } //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { procesopreciosporcentajeOrigen =(ProcesoPreciosPorcentaje) this.procesopreciosporcentajeLogic.getProcesoPreciosPorcentajes().toArray()[this.jTableDatosProcesoPreciosPorcentaje.convertRowIndexToModel(intSelectedRow)]; } else if(Constantes.ISUSAEJBREMOTE || Constantes.ISUSAEJBHOME) { procesopreciosporcentajeOrigen =(ProcesoPreciosPorcentaje) this.procesopreciosporcentajes.toArray()[this.jTableDatosProcesoPreciosPorcentaje.convertRowIndexToModel(intSelectedRow)]; } } this.aumentarTamanioFilaNuevaTablaProcesoPreciosPorcentaje(); if(this.conTotales) { this.quitarFilaTotales(); } this.nuevoPreparar(true); this.procesopreciosporcentaje.setsType("DUPLICADO"); this.setCopiarVariablesObjetosProcesoPreciosPorcentaje(procesopreciosporcentajeOrigen,this.procesopreciosporcentaje,true,true); this.setVariablesFormularioToObjetoActualForeignKeysProcesoPreciosPorcentaje(this.procesopreciosporcentaje); //LO HACE NUEVOPREPARAR /* if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.getProcesoPreciosPorcentajes().add(this.procesopreciosporcentajeAux); } else if(Constantes.ISUSAEJBREMOTE||Constantes.ISUSAEJBHOME) { this.procesopreciosporcentajes.add(this.procesopreciosporcentajeAux); } */ } this.inicializarActualizarBindingTablaProcesoPreciosPorcentaje(false); this.jTableDatosProcesoPreciosPorcentaje.setRowSelectionInterval(this.getIndiceNuevoProcesoPreciosPorcentaje(), this.getIndiceNuevoProcesoPreciosPorcentaje()); int iLastRow = this.jTableDatosProcesoPreciosPorcentaje.getRowCount () - 1; Rectangle rectangle = this.jTableDatosProcesoPreciosPorcentaje.getCellRect(iLastRow, 0, true); this.jTableDatosProcesoPreciosPorcentaje.scrollRectToVisible(rectangle); //FILA TOTALES if(this.conTotales) { this.crearFilaTotales(); this.inicializarActualizarBindingTablaProcesoPreciosPorcentaje(false); } } else { throw new Exception("DEBE ESTAR SELECCIONADO 1 REGISTRO"); } } catch(Exception e) { FuncionesSwing.manageException(this, e,logger,ProcesoPreciosPorcentajeConstantesFunciones.CLASSNAME); } finally { this.estaModoNuevo=false; this.estaModoDuplicar=false; } } public void jButtonCopiarProcesoPreciosPorcentajeActionPerformed(ActionEvent evt) throws Exception { try { Boolean conSeleccionarFilaTabla=false; Integer iNumRowsSeleccionados=0; int[] intSelectedRows =null; int intSelectedRow =0; this.estaModoCopiar=true; ArrayList<ProcesoPreciosPorcentaje> procesopreciosporcentajesSeleccionados=new ArrayList<ProcesoPreciosPorcentaje>(); ProcesoPreciosPorcentaje procesopreciosporcentajeOrigen=new ProcesoPreciosPorcentaje(); ProcesoPreciosPorcentaje procesopreciosporcentajeDestino=new ProcesoPreciosPorcentaje(); procesopreciosporcentajesSeleccionados=this.getProcesoPreciosPorcentajesSeleccionados(false); if(conSeleccionarFilaTabla) { iNumRowsSeleccionados=this.jTableDatosProcesoPreciosPorcentaje.getSelectedRows().length; } if(iNumRowsSeleccionados.equals(2) || procesopreciosporcentajesSeleccionados.size()==2) { if(conSeleccionarFilaTabla) { intSelectedRows =this.jTableDatosProcesoPreciosPorcentaje.getSelectedRows(); intSelectedRow = intSelectedRows[0]; //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { procesopreciosporcentajeOrigen =(ProcesoPreciosPorcentaje) this.procesopreciosporcentajeLogic.getProcesoPreciosPorcentajes().toArray()[this.jTableDatosProcesoPreciosPorcentaje.convertRowIndexToModel(intSelectedRow)]; } else if(Constantes.ISUSAEJBREMOTE || Constantes.ISUSAEJBHOME) { procesopreciosporcentajeOrigen =(ProcesoPreciosPorcentaje) this.procesopreciosporcentajes.toArray()[this.jTableDatosProcesoPreciosPorcentaje.convertRowIndexToModel(intSelectedRow)]; } //ARCHITECTURE intSelectedRow = intSelectedRows[1]; //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { procesopreciosporcentajeDestino =(ProcesoPreciosPorcentaje) this.procesopreciosporcentajeLogic.getProcesoPreciosPorcentajes().toArray()[this.jTableDatosProcesoPreciosPorcentaje.convertRowIndexToModel(intSelectedRow)]; } else if(Constantes.ISUSAEJBREMOTE || Constantes.ISUSAEJBHOME) { procesopreciosporcentajeDestino =(ProcesoPreciosPorcentaje) this.procesopreciosporcentajes.toArray()[this.jTableDatosProcesoPreciosPorcentaje.convertRowIndexToModel(intSelectedRow)]; } //ARCHITECTURE } procesopreciosporcentajeOrigen =procesopreciosporcentajesSeleccionados.get(0); procesopreciosporcentajeDestino =procesopreciosporcentajesSeleccionados.get(1); this.setCopiarVariablesObjetosProcesoPreciosPorcentaje(procesopreciosporcentajeOrigen,procesopreciosporcentajeDestino,true,false); procesopreciosporcentajeDestino.setsType("DUPLICADO"); //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { actualizarLista(procesopreciosporcentajeDestino,procesopreciosporcentajeLogic.getProcesoPreciosPorcentajes()); } else if(Constantes.ISUSAEJBREMOTE||Constantes.ISUSAEJBHOME) { actualizarLista(procesopreciosporcentajeDestino,procesopreciosporcentajes); } //ARCHITECTURE this.inicializarActualizarBindingTablaProcesoPreciosPorcentaje(false); //this.jTableDatosProcesoPreciosPorcentaje.setRowSelectionInterval(this.getIndiceNuevoProcesoPreciosPorcentaje(), this.getIndiceNuevoProcesoPreciosPorcentaje()); int iLastRow = this.jTableDatosProcesoPreciosPorcentaje.getRowCount () - 1; Rectangle rectangle = this.jTableDatosProcesoPreciosPorcentaje.getCellRect(iLastRow, 0, true); this.jTableDatosProcesoPreciosPorcentaje.scrollRectToVisible(rectangle); //FILA TOTALES if(this.conTotales) { //this.crearFilaTotales(); this.inicializarActualizarBindingTablaProcesoPreciosPorcentaje(false); } } else { throw new Exception("DEBEN ESTAR SELECCIONADOS 2 REGISTROS"); } } catch(Exception e) { FuncionesSwing.manageException(this, e,logger,ProcesoPreciosPorcentajeConstantesFunciones.CLASSNAME); } finally { this.estaModoCopiar=false; } } public void jButtonVerFormProcesoPreciosPorcentajeActionPerformed(ActionEvent evt) throws Exception { try { if(this.jInternalFrameDetalleFormProcesoPreciosPorcentaje==null) { //if(!this.conCargarFormDetalle) { this.inicializarFormDetalle(); } this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.setSelected(true); } catch(Exception e) { FuncionesSwing.manageException(this, e,logger,ProcesoPreciosPorcentajeConstantesFunciones.CLASSNAME); } } public void jButtonMostrarOcultarProcesoPreciosPorcentajeActionPerformed(ActionEvent evt) throws Exception { try { Boolean isVisible=this.jPanelParametrosReportesProcesoPreciosPorcentaje.isVisible(); //BYDAN_BUSQUEDAS this.jTabbedPaneBusquedasProcesoPreciosPorcentaje.setVisible(!isVisible); this.jPanelParametrosReportesProcesoPreciosPorcentaje.setVisible(!isVisible); this.jPanelPaginacionProcesoPreciosPorcentaje.setVisible(!isVisible); this.jPanelAccionesProcesoPreciosPorcentaje.setVisible(!isVisible); } catch(Exception e) { FuncionesSwing.manageException(this, e,logger,ProcesoPreciosPorcentajeConstantesFunciones.CLASSNAME); } } public void jButtonCerrarProcesoPreciosPorcentajeActionPerformed(ActionEvent evt) throws Exception { try { this.closingInternalFrameProcesoPreciosPorcentaje(); //if(this.jInternalFrameParent==null) { //this.dispose(); /*} else { this.setVisible(false); this.setSelected(false); }*/ } catch(Exception e) { FuncionesSwing.manageException(this, e,logger,ProcesoPreciosPorcentajeConstantesFunciones.CLASSNAME); } } public void jButtonCerrarReporteDinamicoProcesoPreciosPorcentajeActionPerformed(ActionEvent evt) throws Exception { try { this.cerrarFrameReporteDinamicoProcesoPreciosPorcentaje(); } catch(Exception e) { FuncionesSwing.manageException(this, e,logger,ProcesoPreciosPorcentajeConstantesFunciones.CLASSNAME); } } public void jButtonCerrarImportacionProcesoPreciosPorcentajeActionPerformed(ActionEvent evt) throws Exception { try { this.cerrarFrameImportacionProcesoPreciosPorcentaje(); } catch(Exception e) { FuncionesSwing.manageException(this, e,logger,ProcesoPreciosPorcentajeConstantesFunciones.CLASSNAME); } } public void jButtonAbrirOrderByProcesoPreciosPorcentajeActionPerformed(ActionEvent evt) throws Exception { try { this.abrirInicializarFrameOrderByProcesoPreciosPorcentaje(); this.abrirFrameOrderByProcesoPreciosPorcentaje(); } catch(Exception e) { FuncionesSwing.manageException(this, e,logger,ProcesoPreciosPorcentajeConstantesFunciones.CLASSNAME); } } public void jButtonCerrarOrderByProcesoPreciosPorcentajeActionPerformed(ActionEvent evt) throws Exception { try { this.cerrarFrameOrderByProcesoPreciosPorcentaje(); } catch(Exception e) { FuncionesSwing.manageException(this, e,logger,ProcesoPreciosPorcentajeConstantesFunciones.CLASSNAME); } } public void abrirFrameDetalleProcesoPreciosPorcentaje(Boolean esRelaciones) throws Exception { try { //CAUSA PROBLEMAS, SE ADICIONA EN CONSTRUCTOR, LUEGO SOLO VISIBLE true y false //this.jDesktopPane.add(jInternalFrameDetalleFormProcesoPreciosPorcentaje); if(!esRelaciones) { if(this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.isMaximum()) { this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.setMaximum(false); } this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.setSize(this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.iWidthFormulario,this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.iHeightFormulario); } else { if(this.iWidthScroll<this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.iWidthFormularioMaximo) { this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.setSize(this.iWidthScroll,this.iHeightScroll); } else { if(!this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.isMaximum()) { this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.setMaximum(true); } } if(this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jContentPaneDetalleProcesoPreciosPorcentaje.getWidth() > this.getWidth()) { this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jTabbedPaneRelacionesProcesoPreciosPorcentaje.setMinimumSize(new Dimension(this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jContentPaneDetalleProcesoPreciosPorcentaje.getWidth(),ProcesoPreciosPorcentajeConstantesFunciones.ALTO_TABPANE_RELACIONES)); this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jTabbedPaneRelacionesProcesoPreciosPorcentaje.setMaximumSize(new Dimension(this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jContentPaneDetalleProcesoPreciosPorcentaje.getWidth(),ProcesoPreciosPorcentajeConstantesFunciones.ALTO_TABPANE_RELACIONES)); this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jTabbedPaneRelacionesProcesoPreciosPorcentaje.setPreferredSize(new Dimension(this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jContentPaneDetalleProcesoPreciosPorcentaje.getWidth(),ProcesoPreciosPorcentajeConstantesFunciones.ALTO_TABPANE_RELACIONES)); Dimension dimension=new Dimension(); } } this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.setVisible(true); this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.setSelected(true); } catch (final java.beans.PropertyVetoException e) { FuncionesSwing.manageException(this, e,logger,ProcesoPreciosPorcentajeConstantesFunciones.CLASSNAME); } } public void abrirInicializarFrameOrderByProcesoPreciosPorcentaje() throws Exception { try { if(this.jInternalFrameOrderByProcesoPreciosPorcentaje==null) { if(!this.conCargarMinimo) { this.jInternalFrameOrderByProcesoPreciosPorcentaje=new OrderByJInternalFrame(STIPO_TAMANIO_GENERAL,this.jButtonAbrirOrderByProcesoPreciosPorcentaje,false,this); } else { this.jInternalFrameOrderByProcesoPreciosPorcentaje=new OrderByJInternalFrame(STIPO_TAMANIO_GENERAL,this.jButtonAbrirOrderByProcesoPreciosPorcentaje,true,this); } this.jDesktopPane.add(this.jInternalFrameOrderByProcesoPreciosPorcentaje); this.jInternalFrameOrderByProcesoPreciosPorcentaje.setVisible(false); this.jInternalFrameOrderByProcesoPreciosPorcentaje.setSelected(false); this.jInternalFrameOrderByProcesoPreciosPorcentaje.getjButtonCerrarOrderBy().addActionListener (new ButtonActionListener(this,"CerrarOrderByProcesoPreciosPorcentaje")); this.inicializarActualizarBindingTablaOrderByProcesoPreciosPorcentaje(); } } catch (final Exception e) { } } public void abrirInicializarFrameImportacionProcesoPreciosPorcentaje() throws Exception { try { if(this.jInternalFrameImportacionProcesoPreciosPorcentaje==null) { this.jInternalFrameImportacionProcesoPreciosPorcentaje=new ImportacionJInternalFrame(ProcesoPreciosPorcentajeConstantesFunciones.SCLASSWEBTITULO,this); MainJFrame.cerrarJInternalFramesExistentes(this.jDesktopPane,this.jInternalFrameImportacionProcesoPreciosPorcentaje); this.jDesktopPane.add(this.jInternalFrameImportacionProcesoPreciosPorcentaje); this.jInternalFrameImportacionProcesoPreciosPorcentaje.setVisible(false); this.jInternalFrameImportacionProcesoPreciosPorcentaje.setSelected(false); this.jInternalFrameImportacionProcesoPreciosPorcentaje.getjButtonCerrarImportacion().addActionListener (new ButtonActionListener(this,"CerrarImportacionProcesoPreciosPorcentaje")); this.jInternalFrameImportacionProcesoPreciosPorcentaje.getjButtonGenerarImportacion().addActionListener (new ButtonActionListener(this,"GenerarImportacionProcesoPreciosPorcentaje")); this.jInternalFrameImportacionProcesoPreciosPorcentaje.getjButtonAbrirImportacion().addActionListener (new ButtonActionListener(this,"AbrirImportacionProcesoPreciosPorcentaje")); } } catch (final Exception e) { } } public void abrirInicializarFrameReporteDinamicoProcesoPreciosPorcentaje() throws Exception { try { if(this.jInternalFrameReporteDinamicoProcesoPreciosPorcentaje==null) { this.jInternalFrameReporteDinamicoProcesoPreciosPorcentaje=new ReporteDinamicoJInternalFrame(ProcesoPreciosPorcentajeConstantesFunciones.SCLASSWEBTITULO,this); MainJFrame.cerrarJInternalFramesExistentes(this.jDesktopPane,this.jInternalFrameReporteDinamicoProcesoPreciosPorcentaje); this.jDesktopPane.add(this.jInternalFrameReporteDinamicoProcesoPreciosPorcentaje); this.jInternalFrameReporteDinamicoProcesoPreciosPorcentaje.setVisible(false); this.jInternalFrameReporteDinamicoProcesoPreciosPorcentaje.setSelected(false); this.jInternalFrameReporteDinamicoProcesoPreciosPorcentaje.getjButtonCerrarReporteDinamico().addActionListener (new ButtonActionListener(this,"CerrarReporteDinamicoProcesoPreciosPorcentaje")); this.jInternalFrameReporteDinamicoProcesoPreciosPorcentaje.getjButtonGenerarReporteDinamico().addActionListener (new ButtonActionListener(this,"GenerarReporteDinamicoProcesoPreciosPorcentaje")); this.jInternalFrameReporteDinamicoProcesoPreciosPorcentaje.getjButtonGenerarExcelReporteDinamico().addActionListener (new ButtonActionListener(this,"GenerarExcelReporteDinamicoProcesoPreciosPorcentaje")); this.inicializarActualizarBindingtiposArchivosReportesDinamicoAccionesManualProcesoPreciosPorcentaje(); } } catch (final Exception e) { } } public void cerrarFrameDetalleProcesoPreciosPorcentaje() throws Exception { try { //this.jDesktopPane.add(jInternalFrameDetalleFormProcesoPreciosPorcentaje); this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.setVisible(false); this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.setSelected(false); //this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.dispose(); //this.jInternalFrameDetalleFormProcesoPreciosPorcentaje=null; } catch (final java.beans.PropertyVetoException e) { FuncionesSwing.manageException(this, e,logger,ProcesoPreciosPorcentajeConstantesFunciones.CLASSNAME); } } public void abrirFrameReporteDinamicoProcesoPreciosPorcentaje() throws Exception { try { this.jInternalFrameReporteDinamicoProcesoPreciosPorcentaje.setVisible(true); this.jInternalFrameReporteDinamicoProcesoPreciosPorcentaje.setSelected(true); } catch (final java.beans.PropertyVetoException e) { FuncionesSwing.manageException(this, e,logger,ProcesoPreciosPorcentajeConstantesFunciones.CLASSNAME); } } public void abrirFrameImportacionProcesoPreciosPorcentaje() throws Exception { try { this.jInternalFrameImportacionProcesoPreciosPorcentaje.setVisible(true); this.jInternalFrameImportacionProcesoPreciosPorcentaje.setSelected(true); } catch (final java.beans.PropertyVetoException e) { FuncionesSwing.manageException(this, e,logger,ProcesoPreciosPorcentajeConstantesFunciones.CLASSNAME); } } public void abrirFrameOrderByProcesoPreciosPorcentaje() throws Exception { try { this.jInternalFrameOrderByProcesoPreciosPorcentaje.setVisible(true); this.jInternalFrameOrderByProcesoPreciosPorcentaje.setSelected(true); } catch (final java.beans.PropertyVetoException e) { FuncionesSwing.manageException(this, e,logger,ProcesoPreciosPorcentajeConstantesFunciones.CLASSNAME); } } public void cerrarFrameOrderByProcesoPreciosPorcentaje() throws Exception { try { this.jInternalFrameOrderByProcesoPreciosPorcentaje.setVisible(false); this.jInternalFrameOrderByProcesoPreciosPorcentaje.setSelected(false); } catch (final java.beans.PropertyVetoException e) { FuncionesSwing.manageException(this, e,logger,ProcesoPreciosPorcentajeConstantesFunciones.CLASSNAME); } } public void cerrarFrameReporteDinamicoProcesoPreciosPorcentaje() throws Exception { try { this.jInternalFrameReporteDinamicoProcesoPreciosPorcentaje.setVisible(false); this.jInternalFrameReporteDinamicoProcesoPreciosPorcentaje.setSelected(false); } catch (final java.beans.PropertyVetoException e) { FuncionesSwing.manageException(this, e,logger,ProcesoPreciosPorcentajeConstantesFunciones.CLASSNAME); } } public void cerrarFrameImportacionProcesoPreciosPorcentaje() throws Exception { try { this.jInternalFrameImportacionProcesoPreciosPorcentaje.setVisible(false); this.jInternalFrameImportacionProcesoPreciosPorcentaje.setSelected(false); } catch (final java.beans.PropertyVetoException e) { FuncionesSwing.manageException(this, e,logger,ProcesoPreciosPorcentajeConstantesFunciones.CLASSNAME); } } public void jButtonModificarProcesoPreciosPorcentajeActionPerformed(ActionEvent evt) throws Exception { try { this.modificarProcesoPreciosPorcentaje(evt,-1,false); } catch(Exception e) { FuncionesSwing.manageException(this, e,logger,ProcesoPreciosPorcentajeConstantesFunciones.CLASSNAME); } } public void modificarProcesoPreciosPorcentaje(ActionEvent evt,int rowIndex,Boolean esRelaciones) throws Exception { try { int intSelectedRow = 0; if(rowIndex>=0) { intSelectedRow=rowIndex; } else { intSelectedRow = this.jTableDatosProcesoPreciosPorcentaje.getSelectedRow(); } this.habilitarDeshabilitarControlesProcesoPreciosPorcentaje(true); //this.isEsNuevoProcesoPreciosPorcentaje=false; //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentaje =(ProcesoPreciosPorcentaje) this.procesopreciosporcentajeLogic.getProcesoPreciosPorcentajes().toArray()[this.jTableDatosProcesoPreciosPorcentaje.convertRowIndexToModel(intSelectedRow)]; } else if(Constantes.ISUSAEJBREMOTE || Constantes.ISUSAEJBHOME ) { this.procesopreciosporcentaje =(ProcesoPreciosPorcentaje) this.procesopreciosporcentajes.toArray()[this.jTableDatosProcesoPreciosPorcentaje.convertRowIndexToModel(intSelectedRow)]; } //ARCHITECTURE this.actualizarEstadoCeldasBotonesProcesoPreciosPorcentaje("ae", isGuardarCambiosEnLote, isEsMantenimientoRelacionado); //NO FUNCIONA BINDINGS this.inicializarActualizarBindingBotonesProcesoPreciosPorcentaje(false) ; if(procesopreciosporcentajeSessionBean.getConGuardarRelaciones()) { } if(ProcesoPreciosPorcentajeJInternalFrame.CON_DATOS_FRAME) { this.abrirFrameDetalleProcesoPreciosPorcentaje(esRelaciones); } //SI ES MANUAL //this.inicializarActualizarBindingBotonesManualProcesoPreciosPorcentaje(false) ; } catch(Exception e) { FuncionesSwing.manageException(this, e,logger,ProcesoPreciosPorcentajeConstantesFunciones.CLASSNAME); } } public void seleccionarFilaTablaProcesoPreciosPorcentajeActual() { try { //SELECCIONA FILA A OBJETO ACTUAL Integer intSelectedRow = this.jTableDatosProcesoPreciosPorcentaje.getSelectedRow(); if(intSelectedRow!=null && intSelectedRow>-1) { //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentaje =(ProcesoPreciosPorcentaje) this.procesopreciosporcentajeLogic.getProcesoPreciosPorcentajes().toArray()[this.jTableDatosProcesoPreciosPorcentaje.convertRowIndexToModel(intSelectedRow)]; } else if(Constantes.ISUSAEJBREMOTE || Constantes.ISUSAEJBHOME ) { this.procesopreciosporcentaje =(ProcesoPreciosPorcentaje) this.procesopreciosporcentajes.toArray()[this.jTableDatosProcesoPreciosPorcentaje.convertRowIndexToModel(intSelectedRow)]; } //ARCHITECTURE //System.out.println(this.banco); } } catch(Exception e) { FuncionesSwing.manageException2(this, e,logger,ProcesoPreciosPorcentajeConstantesFunciones.CLASSNAME); } } public void seleccionarProcesoPreciosPorcentaje(ActionEvent evt,int rowIndex) throws Exception { try { if(this.jInternalFrameDetalleFormProcesoPreciosPorcentaje==null) { //if(!this.conCargarFormDetalle) { this.inicializarFormDetalle(); } int intSelectedRow = 0; if(rowIndex>=0) { intSelectedRow=rowIndex; } else { intSelectedRow = this.jTableDatosProcesoPreciosPorcentaje.getSelectedRow(); } //this.habilitarDeshabilitarControlesProcesoPreciosPorcentaje(true); //this.isEsNuevoProcesoPreciosPorcentaje=false; //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentaje =(ProcesoPreciosPorcentaje) this.procesopreciosporcentajeLogic.getProcesoPreciosPorcentajes().toArray()[this.jTableDatosProcesoPreciosPorcentaje.convertRowIndexToModel(intSelectedRow)]; } else if(Constantes.ISUSAEJBREMOTE || Constantes.ISUSAEJBHOME ) { this.procesopreciosporcentaje =(ProcesoPreciosPorcentaje) this.procesopreciosporcentajes.toArray()[this.jTableDatosProcesoPreciosPorcentaje.convertRowIndexToModel(intSelectedRow)]; } //ARCHITECTURE this.jInternalFrameParent.setIdCombosCodigoDesdeBusquedaForeignKey(this.procesopreciosporcentaje.getId(),this.sTipoBusqueda); this.dispose(); //this.actualizarEstadoCeldasBotonesProcesoPreciosPorcentaje("ae", isGuardarCambiosEnLote, isEsMantenimientoRelacionado); //NO FUNCIONA BINDINGS /* this.inicializarActualizarBindingBotonesProcesoPreciosPorcentaje(false) ; if(ProcesoPreciosPorcentajeJInternalFrame.CON_DATOS_FRAME) { this.abrirFrameDetalleProcesoPreciosPorcentaje(esRelaciones); } */ //SI ES MANUAL //this.inicializarActualizarBindingBotonesManualProcesoPreciosPorcentaje(false) ; } catch(Exception e) { FuncionesSwing.manageException(this, e,logger,ProcesoPreciosPorcentajeConstantesFunciones.CLASSNAME); } } public void setIdCombosCodigoDesdeBusquedaForeignKey(Long id,String sType)throws Exception{ try { } catch(Exception e) { throw e; } } public void recargarComboTablaBodega(List<Bodega> bodegasForeignKey)throws Exception{ TableColumn tableColumnBodega=this.jTableDatosProcesoPreciosPorcentaje.getColumnModel().getColumn(Funciones2.getColumnIndexByName(this.jTableDatosProcesoPreciosPorcentaje,ProcesoPreciosPorcentajeConstantesFunciones.LABEL_IDBODEGA)); TableCellEditor tableCellEditorBodega =tableColumnBodega.getCellEditor(); BodegaTableCell bodegaTableCellFk=(BodegaTableCell)tableCellEditorBodega; if(bodegaTableCellFk!=null) { bodegaTableCellFk.setbodegasForeignKey(bodegasForeignKey); } //SIEMPRE rowActual<0 , NO USADO POR EL MOMENTO //COMBO DE FILA ACTUAL SE ACTUALIZA, LOS DEMAS USAN EL ANTERIOR COMBO //int intSelectedRow = -1; //intSelectedRow=this.jTableDatosProcesoPreciosPorcentaje.getSelectedRow(); //if(intSelectedRow<=0) { //bodegaTableCellFk.setRowActual(intSelectedRow); //bodegaTableCellFk.setbodegasForeignKeyActual(bodegasForeignKey); //} if(bodegaTableCellFk!=null) { bodegaTableCellFk.RecargarBodegasForeignKey(); //ACTUALIZA COMBOS DE TABLA-FIN } } public void recargarComboTablaProducto(List<Producto> productosForeignKey)throws Exception{ TableColumn tableColumnProducto=this.jTableDatosProcesoPreciosPorcentaje.getColumnModel().getColumn(Funciones2.getColumnIndexByName(this.jTableDatosProcesoPreciosPorcentaje,ProcesoPreciosPorcentajeConstantesFunciones.LABEL_IDPRODUCTO)); TableCellEditor tableCellEditorProducto =tableColumnProducto.getCellEditor(); ProductoTableCell productoTableCellFk=(ProductoTableCell)tableCellEditorProducto; if(productoTableCellFk!=null) { productoTableCellFk.setproductosForeignKey(productosForeignKey); } //SIEMPRE rowActual<0 , NO USADO POR EL MOMENTO //COMBO DE FILA ACTUAL SE ACTUALIZA, LOS DEMAS USAN EL ANTERIOR COMBO //int intSelectedRow = -1; //intSelectedRow=this.jTableDatosProcesoPreciosPorcentaje.getSelectedRow(); //if(intSelectedRow<=0) { //productoTableCellFk.setRowActual(intSelectedRow); //productoTableCellFk.setproductosForeignKeyActual(productosForeignKey); //} if(productoTableCellFk!=null) { productoTableCellFk.RecargarProductosForeignKey(); //ACTUALIZA COMBOS DE TABLA-FIN } } public void recargarComboTablaLinea(List<Linea> lineasForeignKey)throws Exception{ TableColumn tableColumnLinea=this.jTableDatosProcesoPreciosPorcentaje.getColumnModel().getColumn(Funciones2.getColumnIndexByName(this.jTableDatosProcesoPreciosPorcentaje,ProcesoPreciosPorcentajeConstantesFunciones.LABEL_IDLINEA)); TableCellEditor tableCellEditorLinea =tableColumnLinea.getCellEditor(); LineaTableCell lineaTableCellFk=(LineaTableCell)tableCellEditorLinea; if(lineaTableCellFk!=null) { lineaTableCellFk.setlineasForeignKey(lineasForeignKey); } //SIEMPRE rowActual<0 , NO USADO POR EL MOMENTO //COMBO DE FILA ACTUAL SE ACTUALIZA, LOS DEMAS USAN EL ANTERIOR COMBO //int intSelectedRow = -1; //intSelectedRow=this.jTableDatosProcesoPreciosPorcentaje.getSelectedRow(); //if(intSelectedRow<=0) { //lineaTableCellFk.setRowActual(intSelectedRow); //lineaTableCellFk.setlineasForeignKeyActual(lineasForeignKey); //} if(lineaTableCellFk!=null) { lineaTableCellFk.RecargarLineasForeignKey(); //ACTUALIZA COMBOS DE TABLA-FIN } } public void recargarComboTablaLineaGrupo(List<Linea> lineagruposForeignKey)throws Exception{ TableColumn tableColumnLineaGrupo=this.jTableDatosProcesoPreciosPorcentaje.getColumnModel().getColumn(Funciones2.getColumnIndexByName(this.jTableDatosProcesoPreciosPorcentaje,ProcesoPreciosPorcentajeConstantesFunciones.LABEL_IDLINEAGRUPO)); TableCellEditor tableCellEditorLineaGrupo =tableColumnLineaGrupo.getCellEditor(); LineaTableCell lineaTableCellFk=(LineaTableCell)tableCellEditorLineaGrupo; if(lineaTableCellFk!=null) { lineaTableCellFk.setlineasForeignKey(lineagruposForeignKey); } //SIEMPRE rowActual<0 , NO USADO POR EL MOMENTO //COMBO DE FILA ACTUAL SE ACTUALIZA, LOS DEMAS USAN EL ANTERIOR COMBO //int intSelectedRow = -1; //intSelectedRow=this.jTableDatosProcesoPreciosPorcentaje.getSelectedRow(); //if(intSelectedRow<=0) { //lineaTableCellFk.setRowActual(intSelectedRow); //lineaTableCellFk.setlineasForeignKeyActual(lineagruposForeignKey); //} if(lineaTableCellFk!=null) { lineaTableCellFk.RecargarLineasForeignKey(); //ACTUALIZA COMBOS DE TABLA-FIN } } public void recargarComboTablaLineaCategoria(List<Linea> lineacategoriasForeignKey)throws Exception{ TableColumn tableColumnLineaCategoria=this.jTableDatosProcesoPreciosPorcentaje.getColumnModel().getColumn(Funciones2.getColumnIndexByName(this.jTableDatosProcesoPreciosPorcentaje,ProcesoPreciosPorcentajeConstantesFunciones.LABEL_IDLINEACATEGORIA)); TableCellEditor tableCellEditorLineaCategoria =tableColumnLineaCategoria.getCellEditor(); LineaTableCell lineaTableCellFk=(LineaTableCell)tableCellEditorLineaCategoria; if(lineaTableCellFk!=null) { lineaTableCellFk.setlineasForeignKey(lineacategoriasForeignKey); } //SIEMPRE rowActual<0 , NO USADO POR EL MOMENTO //COMBO DE FILA ACTUAL SE ACTUALIZA, LOS DEMAS USAN EL ANTERIOR COMBO //int intSelectedRow = -1; //intSelectedRow=this.jTableDatosProcesoPreciosPorcentaje.getSelectedRow(); //if(intSelectedRow<=0) { //lineaTableCellFk.setRowActual(intSelectedRow); //lineaTableCellFk.setlineasForeignKeyActual(lineacategoriasForeignKey); //} if(lineaTableCellFk!=null) { lineaTableCellFk.RecargarLineasForeignKey(); //ACTUALIZA COMBOS DE TABLA-FIN } } public void recargarComboTablaLineaMarca(List<Linea> lineamarcasForeignKey)throws Exception{ TableColumn tableColumnLineaMarca=this.jTableDatosProcesoPreciosPorcentaje.getColumnModel().getColumn(Funciones2.getColumnIndexByName(this.jTableDatosProcesoPreciosPorcentaje,ProcesoPreciosPorcentajeConstantesFunciones.LABEL_IDLINEAMARCA)); TableCellEditor tableCellEditorLineaMarca =tableColumnLineaMarca.getCellEditor(); LineaTableCell lineaTableCellFk=(LineaTableCell)tableCellEditorLineaMarca; if(lineaTableCellFk!=null) { lineaTableCellFk.setlineasForeignKey(lineamarcasForeignKey); } //SIEMPRE rowActual<0 , NO USADO POR EL MOMENTO //COMBO DE FILA ACTUAL SE ACTUALIZA, LOS DEMAS USAN EL ANTERIOR COMBO //int intSelectedRow = -1; //intSelectedRow=this.jTableDatosProcesoPreciosPorcentaje.getSelectedRow(); //if(intSelectedRow<=0) { //lineaTableCellFk.setRowActual(intSelectedRow); //lineaTableCellFk.setlineasForeignKeyActual(lineamarcasForeignKey); //} if(lineaTableCellFk!=null) { lineaTableCellFk.RecargarLineasForeignKey(); //ACTUALIZA COMBOS DE TABLA-FIN } } public void jButtonActualizarProcesoPreciosPorcentajeActionPerformed(ActionEvent evt) throws Exception { try { if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.getNewConnexionToDeep(""); } this.inicializarActualizarBindingParametrosReportesProcesoPreciosPorcentaje(false); //if(!this.isEsNuevoProcesoPreciosPorcentaje) { int intSelectedRow = this.jTableDatosProcesoPreciosPorcentaje.getSelectedRow(); //SE PIEDE INDICE SELECTED CON FILA TOTALES, ASEGURARSE QUE OBJETO ACTUAL ESTE EN FORMULARIO //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentaje =(ProcesoPreciosPorcentaje) this.procesopreciosporcentajeLogic.getProcesoPreciosPorcentajes().toArray()[this.jTableDatosProcesoPreciosPorcentaje.convertRowIndexToModel(intSelectedRow)]; } else if(Constantes.ISUSAEJBREMOTE || Constantes.ISUSAEJBHOME) { this.procesopreciosporcentaje =(ProcesoPreciosPorcentaje) this.procesopreciosporcentajes.toArray()[this.jTableDatosProcesoPreciosPorcentaje.convertRowIndexToModel(intSelectedRow)]; } //ARCHITECTURE //} if(ProcesoPreciosPorcentajeJInternalFrame.ISBINDING_MANUAL_TABLA) { this.setVariablesFormularioToObjetoActualProcesoPreciosPorcentaje(this.procesopreciosporcentaje,true); this.setVariablesFormularioToObjetoActualForeignKeysProcesoPreciosPorcentaje(this.procesopreciosporcentaje); } if(this.permiteMantenimiento(this.procesopreciosporcentaje)) { this.actualizar(); if(!this.isGuardarCambiosEnLote && !this.procesopreciosporcentajeSessionBean.getEsGuardarRelacionado()) { this.procesarBusqueda(sAccionBusqueda); this.isEsNuevoProcesoPreciosPorcentaje=true; this.inicializarActualizarBindingTablaProcesoPreciosPorcentaje(false); this.isEsNuevoProcesoPreciosPorcentaje=false; } else { //PARA RELACIONADO ACTUALIZAR FILA TOTALES this.isEsNuevoProcesoPreciosPorcentaje=true; this.procesoActualizarFilaTotales(false,"MANTENIMIENTO"); this.isEsNuevoProcesoPreciosPorcentaje=false; } //NO FUNCIONA BINDINGS this.inicializarActualizarBindingBotonesProcesoPreciosPorcentaje(false); //SI ES MANUAL //this.inicializarActualizarBindingBotonesManualProcesoPreciosPorcentaje(false); this.habilitarDeshabilitarControlesProcesoPreciosPorcentaje(false); if(ProcesoPreciosPorcentajeJInternalFrame.CON_DATOS_FRAME) { if(!this.isPostAccionSinCerrar) { this.cerrarFrameDetalleProcesoPreciosPorcentaje(); } } if(this.isPostAccionNuevo) { this.jButtonNuevoProcesoPreciosPorcentajeActionPerformed(evt,procesopreciosporcentajeSessionBean.getConGuardarRelaciones()); } else { if(this.isPostAccionSinCerrar) { Integer intSelectedRowActual=this.getIndiceActualProcesoPreciosPorcentaje(this.procesopreciosporcentaje,intSelectedRow); if(intSelectedRow>-1) { this.jTableDatosProcesoPreciosPorcentaje.setRowSelectionInterval(intSelectedRowActual, intSelectedRowActual); this.jButtonIdActionPerformed(evt,intSelectedRowActual,procesopreciosporcentajeSessionBean.getConGuardarRelaciones(),false); } } } this.cancelar(false); } else { JOptionPane.showMessageDialog(this,"ESTE REGISTRO NO PUEDE ACTUALIZARSE","EDITAR",JOptionPane.ERROR_MESSAGE); } if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.commitNewConnexionToDeep(); } if(this.jInternalFrameParent!=null) { //&& this.isEsMantenimientoRelacionado) { Boolean esUsoDesdeHijoLocal=true; String sTipo="Formulario"; Boolean conIrServidorAplicacionParent=false; Long id=this.procesopreciosporcentaje.getId(); ArrayList<String> arrClasses=new ArrayList<String>(); GeneralEntityParameterGeneral generalEntityParameterGeneral=new GeneralEntityParameterGeneral(); generalEntityParameterGeneral.setEventoGlobalTipo(EventoGlobalTipo.FORM_HIJO_ACTUALIZAR); generalEntityParameterGeneral.setsDominio("Formulario"); generalEntityParameterGeneral.setsDominioTipo(ProcesoPreciosPorcentaje.class.getName()); this.jInternalFrameParent.setEventoParentGeneral(esUsoDesdeHijoLocal,"Formulario",ProcesoPreciosPorcentaje.class.getName(),sTipo,"FORMULARIO",esControlTabla,conIrServidorAplicacionParent, id,this, EventoGlobalTipo.FORM_HIJO_ACTUALIZAR,ControlTipo.FORM,EventoTipo.CHANGE,EventoSubTipo.CHANGED,arrClasses, evt,generalEntityParameterGeneral,this); } } catch(Exception e) { if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.rollbackNewConnexionToDeep(); } FuncionesSwing.manageException(this, e,logger,ProcesoPreciosPorcentajeConstantesFunciones.CLASSNAME); } finally { if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.closeNewConnexionToDeep(); } } } public void jButtonEliminarProcesoPreciosPorcentajeActionPerformed(ActionEvent evt) throws Exception { try { if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.getNewConnexionToDeep(""); } int intSelectedRow = this.jTableDatosProcesoPreciosPorcentaje.getSelectedRow(); //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentaje =(ProcesoPreciosPorcentaje) this.procesopreciosporcentajeLogic.getProcesoPreciosPorcentajes().toArray()[this.jTableDatosProcesoPreciosPorcentaje.convertRowIndexToModel(intSelectedRow)]; this.procesopreciosporcentaje.setIsDeleted(true); } else if(Constantes.ISUSAEJBREMOTE || Constantes.ISUSAEJBHOME ) { this.procesopreciosporcentaje =(ProcesoPreciosPorcentaje) this.procesopreciosporcentajes.toArray()[this.jTableDatosProcesoPreciosPorcentaje.convertRowIndexToModel(intSelectedRow)]; this.procesopreciosporcentaje.setIsDeleted(true); } //ARCHITECTURE if(this.permiteMantenimiento(this.procesopreciosporcentaje)) { this.eliminar(); if(!this.isGuardarCambiosEnLote && !this.procesopreciosporcentajeSessionBean.getEsGuardarRelacionado()) { this.procesarBusqueda(sAccionBusqueda); } ((ProcesoPreciosPorcentajeModel) this.jTableDatosProcesoPreciosPorcentaje.getModel()).fireTableRowsDeleted(intSelectedRow,intSelectedRow); this.isEsNuevoProcesoPreciosPorcentaje=true; this.inicializarActualizarBindingTablaProcesoPreciosPorcentaje(false); this.isEsNuevoProcesoPreciosPorcentaje=false; //NO FUNCIONA BINDINGS this.inicializarActualizarBindingBotonesProcesoPreciosPorcentaje(false); //SI ES MANUAL //this.inicializarActualizarBindingBotonesManualProcesoPreciosPorcentaje(false); this.habilitarDeshabilitarControlesProcesoPreciosPorcentaje(false); if(ProcesoPreciosPorcentajeJInternalFrame.CON_DATOS_FRAME) { this.cerrarFrameDetalleProcesoPreciosPorcentaje(); } } else { JOptionPane.showMessageDialog(this,"ESTE REGISTRO NO PUEDE ACTUALIZARSE","EDITAR",JOptionPane.ERROR_MESSAGE); } if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.commitNewConnexionToDeep(); } } catch(Exception e) { if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.rollbackNewConnexionToDeep(); } FuncionesSwing.manageException(this, e,logger,ProcesoPreciosPorcentajeConstantesFunciones.CLASSNAME); } finally { if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.closeNewConnexionToDeep(); } } } public void jButtonCancelarProcesoPreciosPorcentajeActionPerformed(ActionEvent evt) throws Exception { try { if(jTableDatosProcesoPreciosPorcentaje.getRowCount()>=1) { jTableDatosProcesoPreciosPorcentaje.removeRowSelectionInterval(0, jTableDatosProcesoPreciosPorcentaje.getRowCount()-1); } this.invalidValues=new InvalidValue[0]; this.habilitarDeshabilitarControlesProcesoPreciosPorcentaje(false); this.cancelar(true); this.inicializarActualizarBindingTablaProcesoPreciosPorcentaje(false); //NO FUNCIONA BINDINGS this.inicializarActualizarBindingBotonesProcesoPreciosPorcentaje(false) ; //SI ES MANUAL //this.inicializarActualizarBindingBotonesManualProcesoPreciosPorcentaje(false) ; this.isEsNuevoProcesoPreciosPorcentaje=false; if(ProcesoPreciosPorcentajeJInternalFrame.CON_DATOS_FRAME) { this.cerrarFrameDetalleProcesoPreciosPorcentaje(); } } catch(Exception e) { FuncionesSwing.manageException(this, e,logger,ProcesoPreciosPorcentajeConstantesFunciones.CLASSNAME); } } public void jButtonGuardarCambiosProcesoPreciosPorcentajeActionPerformed(ActionEvent evt) throws Exception { try { if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.getNewConnexionToDeep(""); } //this.estaModoGuardarCambios=true; this.guardarCambios(); if(!this.isErrorGuardar) { this.procesarBusqueda(this.sAccionBusqueda); //NO FUNCIONA BINDINGS this.inicializarActualizarBindingProcesoPreciosPorcentaje(false); //SI ES MANUAL if(ProcesoPreciosPorcentajeJInternalFrame.ISBINDING_MANUAL) { //this.inicializarActualizarBindingManualProcesoPreciosPorcentaje(); } } if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.commitNewConnexionToDeep(); } } catch(Exception e) { if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.rollbackNewConnexionToDeep(); } FuncionesSwing.manageException(this, e,logger,ProcesoPreciosPorcentajeConstantesFunciones.CLASSNAME); } finally { if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.closeNewConnexionToDeep(); } //this.estaModoGuardarCambios=false; } } public void jButtonNuevoGuardarCambiosProcesoPreciosPorcentajeActionPerformed(ActionEvent evt) throws Exception { try { this.estaModoNuevo=true; this.estaModoNuevoGuardarCambios=true; //LO HACE NUEVOPREPARAR //this.iIdNuevoProcesoPreciosPorcentaje--; //ProcesoPreciosPorcentaje procesopreciosporcentajeAux= new ProcesoPreciosPorcentaje(); //procesopreciosporcentajeAux.setId(this.iIdNuevoProcesoPreciosPorcentaje); if(this.jInternalFrameDetalleFormProcesoPreciosPorcentaje==null) { //if(!this.conCargarFormDetalle) { this.inicializarFormDetalle(); } this.aumentarTamanioFilaNuevaTablaProcesoPreciosPorcentaje(); if(this.conTotales) { this.quitarFilaTotales(); } this.nuevoPreparar(true); this.setVariablesFormularioToObjetoActualForeignKeysProcesoPreciosPorcentaje(this.procesopreciosporcentaje); this.procesopreciosporcentaje.setsType("NUEVO_GUARDAR_CAMBIOS"); //LO HACE NUEVOPREPARAR /* if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.getProcesoPreciosPorcentajes().add(this.procesopreciosporcentajeAux); } else if(Constantes.ISUSAEJBREMOTE||Constantes.ISUSAEJBHOME) { this.procesopreciosporcentajes.add(this.procesopreciosporcentajeAux); } */ this.inicializarActualizarBindingTablaProcesoPreciosPorcentaje(false); this.jTableDatosProcesoPreciosPorcentaje.setRowSelectionInterval(this.getIndiceNuevoProcesoPreciosPorcentaje(), this.getIndiceNuevoProcesoPreciosPorcentaje()); int iLastRow = this.jTableDatosProcesoPreciosPorcentaje.getRowCount () - 1; Rectangle rectangle = this.jTableDatosProcesoPreciosPorcentaje.getCellRect(iLastRow, 0, true); this.jTableDatosProcesoPreciosPorcentaje.scrollRectToVisible(rectangle); //FILA TOTALES if(this.conTotales) { this.crearFilaTotales(); this.inicializarActualizarBindingTablaProcesoPreciosPorcentaje(false); } } catch(Exception e) { FuncionesSwing.manageException(this, e,logger,ProcesoPreciosPorcentajeConstantesFunciones.CLASSNAME); } finally { this.estaModoNuevo=false; this.estaModoNuevoGuardarCambios=false; } } public void jButtonRecargarInformacionProcesoPreciosPorcentajeActionPerformed(ActionEvent evt) throws Exception { try { this.iNumeroPaginacionPagina=0; if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.getNewConnexionToDeep(""); } this.inicializarActualizarBindingProcesoPreciosPorcentaje(false,false); this.recargarInformacion(); //NO FUNCIONA BINDINGS this.inicializarActualizarBindingProcesoPreciosPorcentaje(false); //SI ES MANUAL if(ProcesoPreciosPorcentajeJInternalFrame.ISBINDING_MANUAL) { //this.inicializarActualizarBindingManualProcesoPreciosPorcentaje(); } //this.abrirFrameTreeProcesoPreciosPorcentaje(); if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.commitNewConnexionToDeep(); } } catch(Exception e) { if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.rollbackNewConnexionToDeep(); } FuncionesSwing.manageException(this, e,logger,ProcesoPreciosPorcentajeConstantesFunciones.CLASSNAME); } finally { if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.closeNewConnexionToDeep(); } } } public void jButtonGenerarImportacionProcesoPreciosPorcentajeActionPerformed(ActionEvent evt) throws Exception { BufferedReader bufferedReader = null; String sXmlStringFile=""; String sPath=""; this.arrDatoGeneralMinimos= new ArrayList<DatoGeneralMinimo>(); DatoGeneralMinimo datoGeneralMinimo=new DatoGeneralMinimo(); String sLine=""; try { } catch(Exception e) { FuncionesSwing.manageException(this, e,logger,ProcesoPreciosPorcentajeConstantesFunciones.CLASSNAME); } finally { if (bufferedReader != null) { bufferedReader.close(); } } } public void jButtonAbrirImportacionProcesoPreciosPorcentajeActionPerformed(ActionEvent evt) throws Exception { BufferedWriter bufferedWriter = null; String sXmlStringFile=""; String sPath=""; try { int iReturnArchivo = this.jInternalFrameImportacionProcesoPreciosPorcentaje.getjFileChooserImportacion().showOpenDialog(this); if (iReturnArchivo == JFileChooser.APPROVE_OPTION) { this.jInternalFrameImportacionProcesoPreciosPorcentaje.setFileImportacion(this.jInternalFrameImportacionProcesoPreciosPorcentaje.getjFileChooserImportacion().getSelectedFile()); this.jInternalFrameImportacionProcesoPreciosPorcentaje.getjTextFieldPathArchivoImportacion().setText(this.jInternalFrameImportacionProcesoPreciosPorcentaje.getFileImportacion().getName()); //System.out.println("ARCHIVO ESCOGIDO: "+this.fileImportacionProcesoPreciosPorcentaje.getName()); } else { //System.out.println("CANCELAR SELECCION"); this.jInternalFrameImportacionProcesoPreciosPorcentaje.getjTextFieldPathArchivoImportacion().setText("SELECCION CANCELADA"); } } catch(Exception e) { FuncionesSwing.manageException(this, e,logger,ProcesoPreciosPorcentajeConstantesFunciones.CLASSNAME); } finally { if (bufferedWriter != null) { bufferedWriter.close(); } } } public void jButtonGenerarReporteDinamicoProcesoPreciosPorcentajeActionPerformed(ActionEvent evt) throws Exception { BufferedWriter bufferedWriter = null; String sXmlStringFile=""; String sPath=""; try { ArrayList<ProcesoPreciosPorcentaje> procesopreciosporcentajesSeleccionados=new ArrayList<ProcesoPreciosPorcentaje>(); procesopreciosporcentajesSeleccionados=this.getProcesoPreciosPorcentajesSeleccionados(true); this.sTipoReporteDinamico=((Reporte)this.jInternalFrameReporteDinamicoProcesoPreciosPorcentaje.getjComboBoxTiposReportesDinamico().getSelectedItem()).getsCodigo(); this.sTipoArchivoReporteDinamico=((Reporte)this.jInternalFrameReporteDinamicoProcesoPreciosPorcentaje.getjComboBoxTiposArchivosReportesDinamico().getSelectedItem()).getsCodigo(); this.sTipoArchivoReporte=this.sTipoArchivoReporteDinamico; //this.sTipoReporteExtra="Base"; InputStream reportFile=null; InputStream imageFile=null; imageFile=AuxiliarImagenes.class.getResourceAsStream("LogoReporte.jpg"); reportFile = AuxiliarReportes.class.getResourceAsStream("ProcesoPreciosPorcentajeBaseDesign.jrxml"); sPath=this.parametroGeneralUsuario.getpath_exportar()+"ProcesoPreciosPorcentajeBaseDesign.jrxml"; sXmlStringFile=Funciones2.getStringFromInputStream(reportFile); bufferedWriter = new BufferedWriter(new FileWriter(sPath)); sXmlStringFile=this.actualizarReporteDinamico(sXmlStringFile); bufferedWriter.write(sXmlStringFile); bufferedWriter.close(); try{JasperCompileManager.compileReportToFile(sPath);}catch(Exception e){e.printStackTrace();} this.actualizarVariablesTipoReporte(false,true,false,sPath); /* this.esReporteDinamico=true; this.sPathReporteDinamico=sPath.replace(".jrxml",".jasper"); this.sTipoReporteExtra=""; */ this.generarReporteProcesoPreciosPorcentajes("Todos",procesopreciosporcentajesSeleccionados ); if(this.parametroGeneralUsuario.getcon_mensaje_confirmacion() && !this.procesopreciosporcentajeSessionBean.getEsGuardarRelacionado()) {//Constantes.ISMOSTRARMENSAJESMANTENIMIENTO && //DEBE APARECER EL REPORTE DIRECTAMENTE //JOptionPane.showMessageDialog(this,"GENERADO CORRECTAMENTE:"+sPath,"MANTENIMIENTO DE Proceso Precios Porcentaje",JOptionPane.INFORMATION_MESSAGE); } } catch(Exception e) { FuncionesSwing.manageException(this, e,logger,ProcesoPreciosPorcentajeConstantesFunciones.CLASSNAME); } finally { if (bufferedWriter != null) { bufferedWriter.close(); } } } public String actualizarReporteDinamico(String sXmlStringFile) { Reporte reporte=new Reporte(); Integer iAnchoMaximoVertical=535;//781,782 Integer iAnchoMaximoHorizontal=782; Integer iAnchoSum=0; Integer iAnchoColumna=0; Integer iAnchoMargenes=60; String sWidthGrafico="535"; for(int index:this.jInternalFrameReporteDinamicoProcesoPreciosPorcentaje.getjListColumnasSelectReporte().getSelectedIndices()) { reporte=(Reporte)this.jInternalFrameReporteDinamicoProcesoPreciosPorcentaje.getjListColumnasSelectReporte().getModel().getElementAt(index); switch(reporte.getsCodigo()) { case ProcesoPreciosPorcentajeConstantesFunciones.LABEL_CODIGO: iAnchoColumna=100; if(iAnchoSum+iAnchoColumna<=iAnchoMaximoHorizontal) { sXmlStringFile=sXmlStringFile.replace("<!--col_digo_col", ""); sXmlStringFile=sXmlStringFile.replace("col_digo_col-->", ""); sXmlStringFile=sXmlStringFile.replace("colancho_digo_colancho", iAnchoColumna.toString()); sXmlStringFile=sXmlStringFile.replace("colx_digo_colx", iAnchoSum.toString()); iAnchoSum+=iAnchoColumna; } break; case ProcesoPreciosPorcentajeConstantesFunciones.LABEL_NOMBRE: iAnchoColumna=100; if(iAnchoSum+iAnchoColumna<=iAnchoMaximoHorizontal) { sXmlStringFile=sXmlStringFile.replace("<!--col_mbre_col", ""); sXmlStringFile=sXmlStringFile.replace("col_mbre_col-->", ""); sXmlStringFile=sXmlStringFile.replace("colancho_mbre_colancho", iAnchoColumna.toString()); sXmlStringFile=sXmlStringFile.replace("colx_mbre_colx", iAnchoSum.toString()); iAnchoSum+=iAnchoColumna; } break; case ProcesoPreciosPorcentajeConstantesFunciones.LABEL_CODIGOPRODUCTO: iAnchoColumna=100; if(iAnchoSum+iAnchoColumna<=iAnchoMaximoHorizontal) { sXmlStringFile=sXmlStringFile.replace("<!--col_digoProducto_col", ""); sXmlStringFile=sXmlStringFile.replace("col_digoProducto_col-->", ""); sXmlStringFile=sXmlStringFile.replace("colancho_digoProducto_colancho", iAnchoColumna.toString()); sXmlStringFile=sXmlStringFile.replace("colx_digoProducto_colx", iAnchoSum.toString()); iAnchoSum+=iAnchoColumna; } break; case ProcesoPreciosPorcentajeConstantesFunciones.LABEL_NOMBREPRODUCTO: iAnchoColumna=100; if(iAnchoSum+iAnchoColumna<=iAnchoMaximoHorizontal) { sXmlStringFile=sXmlStringFile.replace("<!--col_mbreProducto_col", ""); sXmlStringFile=sXmlStringFile.replace("col_mbreProducto_col-->", ""); sXmlStringFile=sXmlStringFile.replace("colancho_mbreProducto_colancho", iAnchoColumna.toString()); sXmlStringFile=sXmlStringFile.replace("colx_mbreProducto_colx", iAnchoSum.toString()); iAnchoSum+=iAnchoColumna; } break; case ProcesoPreciosPorcentajeConstantesFunciones.LABEL_PRECIO: iAnchoColumna=50; if(iAnchoSum+iAnchoColumna<=iAnchoMaximoHorizontal) { sXmlStringFile=sXmlStringFile.replace("<!--col_ecio_col", ""); sXmlStringFile=sXmlStringFile.replace("col_ecio_col-->", ""); sXmlStringFile=sXmlStringFile.replace("colancho_ecio_colancho", iAnchoColumna.toString()); sXmlStringFile=sXmlStringFile.replace("colx_ecio_colx", iAnchoSum.toString()); iAnchoSum+=iAnchoColumna; } break; case ProcesoPreciosPorcentajeConstantesFunciones.LABEL_PORCENTAJE: iAnchoColumna=50; if(iAnchoSum+iAnchoColumna<=iAnchoMaximoHorizontal) { sXmlStringFile=sXmlStringFile.replace("<!--col_rcentaje_col", ""); sXmlStringFile=sXmlStringFile.replace("col_rcentaje_col-->", ""); sXmlStringFile=sXmlStringFile.replace("colancho_rcentaje_colancho", iAnchoColumna.toString()); sXmlStringFile=sXmlStringFile.replace("colx_rcentaje_colx", iAnchoSum.toString()); iAnchoSum+=iAnchoColumna; } break; default : break; } } iAnchoSum+=iAnchoMargenes; if(iAnchoSum>iAnchoMaximoVertical) { sXmlStringFile=sXmlStringFile.replace("595", "842"); //sXmlStringFile=sXmlStringFile.replace("842", "595"); sXmlStringFile=sXmlStringFile.replace("535", "782"); sXmlStringFile=sXmlStringFile.replace("Portrait", "Landscape"); sWidthGrafico="782"; } else { sXmlStringFile=sXmlStringFile.replace("842", "595"); //sXmlStringFile=sXmlStringFile.replace("595", "842"); sXmlStringFile=sXmlStringFile.replace("782", "535"); sXmlStringFile=sXmlStringFile.replace("Landscape", "Portrait"); sWidthGrafico="535"; } if(this.jInternalFrameReporteDinamicoProcesoPreciosPorcentaje.getjCheckBoxConGraficoDinamico().isSelected()) { sXmlStringFile=this.actualizarGraficoReporteDinamico(sXmlStringFile,sWidthGrafico); } else { sXmlStringFile=sXmlStringFile.replace("colancho_summary_colancho", "30"); } return sXmlStringFile; } public String actualizarGraficoReporteDinamico(String sXmlStringFile,String sWidthGrafico) { String strGrafico=""; String sTipo="NORMAL"; String strCategorySeries=""; String sNombreCampoCategoria=""; String sNombreCampoCategoriaValor=""; Reporte reporte=new Reporte(); Reporte reporteCategoriaValor=new Reporte(); Reporte reporteTipoGraficoReporte=new Reporte(); Boolean existe=false; sXmlStringFile=sXmlStringFile.replace("colancho_summary_colancho", "280"); //CATEGORIA GRAFICO reporte=((Reporte)this.jInternalFrameReporteDinamicoProcesoPreciosPorcentaje.getjComboBoxColumnaCategoriaGrafico().getSelectedItem()); //TIPO GRAFICO REPORTE reporteTipoGraficoReporte=((Reporte)this.jInternalFrameReporteDinamicoProcesoPreciosPorcentaje.getjComboBoxTiposGraficosReportesDinamico().getSelectedItem()); String sTipoGraficoReporte=reporteTipoGraficoReporte.getsCodigo(); switch(reporte.getsCodigo()) { case ProcesoPreciosPorcentajeConstantesFunciones.LABEL_CODIGO: sNombreCampoCategoria="codigo"; break; case ProcesoPreciosPorcentajeConstantesFunciones.LABEL_NOMBRE: sNombreCampoCategoria="nombre"; break; case ProcesoPreciosPorcentajeConstantesFunciones.LABEL_CODIGOPRODUCTO: sNombreCampoCategoria="codigo_producto"; break; case ProcesoPreciosPorcentajeConstantesFunciones.LABEL_NOMBREPRODUCTO: sNombreCampoCategoria="nombre_producto"; break; case ProcesoPreciosPorcentajeConstantesFunciones.LABEL_PRECIO: sNombreCampoCategoria="precio"; break; case ProcesoPreciosPorcentajeConstantesFunciones.LABEL_PORCENTAJE: sNombreCampoCategoria="porcentaje"; break; default : break; } //CATEGORIA GRAFICO //CATEGORIA VALOR reporteCategoriaValor=((Reporte)this.jInternalFrameReporteDinamicoProcesoPreciosPorcentaje.getjComboBoxColumnaCategoriaValor().getSelectedItem()); switch(reporteCategoriaValor.getsCodigo()) { case ProcesoPreciosPorcentajeConstantesFunciones.LABEL_CODIGO: sNombreCampoCategoriaValor="codigo"; break; case ProcesoPreciosPorcentajeConstantesFunciones.LABEL_NOMBRE: sNombreCampoCategoriaValor="nombre"; break; case ProcesoPreciosPorcentajeConstantesFunciones.LABEL_CODIGOPRODUCTO: sNombreCampoCategoriaValor="codigo_producto"; break; case ProcesoPreciosPorcentajeConstantesFunciones.LABEL_NOMBREPRODUCTO: sNombreCampoCategoriaValor="nombre_producto"; break; case ProcesoPreciosPorcentajeConstantesFunciones.LABEL_PRECIO: sNombreCampoCategoriaValor="precio"; break; case ProcesoPreciosPorcentajeConstantesFunciones.LABEL_PORCENTAJE: sNombreCampoCategoriaValor="porcentaje"; break; default : break; } //CATEGORIA VALOR //VALORES GRAFICO for(int index:this.jInternalFrameReporteDinamicoProcesoPreciosPorcentaje.getjListColumnasValoresGrafico().getSelectedIndices()) { reporte=(Reporte)this.jInternalFrameReporteDinamicoProcesoPreciosPorcentaje.getjListColumnasValoresGrafico().getModel().getElementAt(index); switch(reporte.getsCodigo()) { case ProcesoPreciosPorcentajeConstantesFunciones.LABEL_CODIGO: strCategorySeries+=FuncionesReporte.getStringCategoryGraficoNormalReporte(sTipoGraficoReporte,"Codigo",sNombreCampoCategoria,sNombreCampoCategoriaValor,"codigo"); break; case ProcesoPreciosPorcentajeConstantesFunciones.LABEL_NOMBRE: strCategorySeries+=FuncionesReporte.getStringCategoryGraficoNormalReporte(sTipoGraficoReporte,"Nombre",sNombreCampoCategoria,sNombreCampoCategoriaValor,"nombre"); break; case ProcesoPreciosPorcentajeConstantesFunciones.LABEL_CODIGOPRODUCTO: strCategorySeries+=FuncionesReporte.getStringCategoryGraficoNormalReporte(sTipoGraficoReporte,"Codigo Producto",sNombreCampoCategoria,sNombreCampoCategoriaValor,"codigo_producto"); break; case ProcesoPreciosPorcentajeConstantesFunciones.LABEL_NOMBREPRODUCTO: strCategorySeries+=FuncionesReporte.getStringCategoryGraficoNormalReporte(sTipoGraficoReporte,"Nombre Producto",sNombreCampoCategoria,sNombreCampoCategoriaValor,"nombre_producto"); break; case ProcesoPreciosPorcentajeConstantesFunciones.LABEL_PRECIO: strCategorySeries+=FuncionesReporte.getStringCategoryGraficoNormalReporte(sTipoGraficoReporte,"Precio",sNombreCampoCategoria,sNombreCampoCategoriaValor,"precio"); break; case ProcesoPreciosPorcentajeConstantesFunciones.LABEL_PORCENTAJE: strCategorySeries+=FuncionesReporte.getStringCategoryGraficoNormalReporte(sTipoGraficoReporte,"Porcentaje",sNombreCampoCategoria,sNombreCampoCategoriaValor,"porcentaje"); break; default : break; } } //VALORES GRAFICO //if(sTipoGraficoReporte.equals("BARRAS") || sTipoGraficoReporte.equals("BARRAS_3D") || sTipoGraficoReporte.equals("BARRAS_XY") || // sTipoGraficoReporte.equals("PASTEL") || sTipoGraficoReporte.equals("PASTEL_3D") || sTipoGraficoReporte.equals("APILADO")) { existe=true; strGrafico=FuncionesReporte.getStringGraficoReporte(sTipoGraficoReporte,sWidthGrafico,strCategorySeries); //} if(existe) { sXmlStringFile=sXmlStringFile.replace("<!--GRAFICO-->", strGrafico); } return sXmlStringFile; } //@SuppressWarnings("deprecation") public void jButtonGenerarExcelReporteDinamicoProcesoPreciosPorcentajeActionPerformed(ActionEvent evt) throws Exception { ArrayList<ProcesoPreciosPorcentaje> procesopreciosporcentajesSeleccionados=new ArrayList<ProcesoPreciosPorcentaje>(); procesopreciosporcentajesSeleccionados=this.getProcesoPreciosPorcentajesSeleccionados(true); String sTipo=Funciones2.getTipoExportar(this.parametroGeneralUsuario); Boolean conCabecera=this.parametroGeneralUsuario.getcon_exportar_cabecera(); String sDelimiter=Funciones2.getTipoDelimiter(this.parametroGeneralUsuario); String sPath=this.parametroGeneralUsuario.getpath_exportar()+"procesopreciosporcentaje";//.xls"; String sFilaCabecera=""; String sFilaDatos=""; Boolean existeFilas=false; Workbook workbook = null; FileOutputStream fileOutputStream=null; Reporte reporte=new Reporte(); try { if(sTipoArchivoReporte=="EXCEL2") { workbook = new HSSFWorkbook(); sPath+=".xls"; } else if(sTipoArchivoReporte=="EXCEL2_2") { workbook = new XSSFWorkbook(); sPath+=".xlsx"; } Sheet sheet = workbook.createSheet("ProcesoPreciosPorcentajes"); Integer iRow=0; Integer iCell=0; Row row = sheet.createRow(iRow); Cell cell = row.createCell(iCell); //cell.setCellValue("Blahblah"); for(int index:this.jInternalFrameReporteDinamicoProcesoPreciosPorcentaje.getjListColumnasSelectReporte().getSelectedIndices()) { reporte=(Reporte)this.jInternalFrameReporteDinamicoProcesoPreciosPorcentaje.getjListColumnasSelectReporte().getModel().getElementAt(index); switch(reporte.getsCodigo()) { case ProcesoPreciosPorcentajeConstantesFunciones.LABEL_IDBODEGA: iRow=0; if(!existeFilas) {row = sheet.createRow(iRow);} else {row=sheet.getRow(iRow);} cell = row.createCell(iCell); cell.setCellValue(ProcesoPreciosPorcentajeConstantesFunciones.LABEL_IDBODEGA); iRow++; for(ProcesoPreciosPorcentaje procesopreciosporcentaje:procesopreciosporcentajesSeleccionados) { if(!existeFilas) {row = sheet.createRow(iRow);} else {row=sheet.getRow(iRow);} cell = row.createCell(iCell); cell.setCellValue(procesopreciosporcentaje.getbodega_descripcion()); iRow++; } existeFilas=true; iCell++; break; case ProcesoPreciosPorcentajeConstantesFunciones.LABEL_IDPRODUCTO: iRow=0; if(!existeFilas) {row = sheet.createRow(iRow);} else {row=sheet.getRow(iRow);} cell = row.createCell(iCell); cell.setCellValue(ProcesoPreciosPorcentajeConstantesFunciones.LABEL_IDPRODUCTO); iRow++; for(ProcesoPreciosPorcentaje procesopreciosporcentaje:procesopreciosporcentajesSeleccionados) { if(!existeFilas) {row = sheet.createRow(iRow);} else {row=sheet.getRow(iRow);} cell = row.createCell(iCell); cell.setCellValue(procesopreciosporcentaje.getproducto_descripcion()); iRow++; } existeFilas=true; iCell++; break; case ProcesoPreciosPorcentajeConstantesFunciones.LABEL_IDEMPRESA: iRow=0; if(!existeFilas) {row = sheet.createRow(iRow);} else {row=sheet.getRow(iRow);} cell = row.createCell(iCell); cell.setCellValue(ProcesoPreciosPorcentajeConstantesFunciones.LABEL_IDEMPRESA); iRow++; for(ProcesoPreciosPorcentaje procesopreciosporcentaje:procesopreciosporcentajesSeleccionados) { if(!existeFilas) {row = sheet.createRow(iRow);} else {row=sheet.getRow(iRow);} cell = row.createCell(iCell); cell.setCellValue(procesopreciosporcentaje.getempresa_descripcion()); iRow++; } existeFilas=true; iCell++; break; case ProcesoPreciosPorcentajeConstantesFunciones.LABEL_IDSUCURSAL: iRow=0; if(!existeFilas) {row = sheet.createRow(iRow);} else {row=sheet.getRow(iRow);} cell = row.createCell(iCell); cell.setCellValue(ProcesoPreciosPorcentajeConstantesFunciones.LABEL_IDSUCURSAL); iRow++; for(ProcesoPreciosPorcentaje procesopreciosporcentaje:procesopreciosporcentajesSeleccionados) { if(!existeFilas) {row = sheet.createRow(iRow);} else {row=sheet.getRow(iRow);} cell = row.createCell(iCell); cell.setCellValue(procesopreciosporcentaje.getsucursal_descripcion()); iRow++; } existeFilas=true; iCell++; break; case ProcesoPreciosPorcentajeConstantesFunciones.LABEL_IDLINEA: iRow=0; if(!existeFilas) {row = sheet.createRow(iRow);} else {row=sheet.getRow(iRow);} cell = row.createCell(iCell); cell.setCellValue(ProcesoPreciosPorcentajeConstantesFunciones.LABEL_IDLINEA); iRow++; for(ProcesoPreciosPorcentaje procesopreciosporcentaje:procesopreciosporcentajesSeleccionados) { if(!existeFilas) {row = sheet.createRow(iRow);} else {row=sheet.getRow(iRow);} cell = row.createCell(iCell); cell.setCellValue(procesopreciosporcentaje.getlinea_descripcion()); iRow++; } existeFilas=true; iCell++; break; case ProcesoPreciosPorcentajeConstantesFunciones.LABEL_IDLINEAGRUPO: iRow=0; if(!existeFilas) {row = sheet.createRow(iRow);} else {row=sheet.getRow(iRow);} cell = row.createCell(iCell); cell.setCellValue(ProcesoPreciosPorcentajeConstantesFunciones.LABEL_IDLINEAGRUPO); iRow++; for(ProcesoPreciosPorcentaje procesopreciosporcentaje:procesopreciosporcentajesSeleccionados) { if(!existeFilas) {row = sheet.createRow(iRow);} else {row=sheet.getRow(iRow);} cell = row.createCell(iCell); cell.setCellValue(procesopreciosporcentaje.getlineagrupo_descripcion()); iRow++; } existeFilas=true; iCell++; break; case ProcesoPreciosPorcentajeConstantesFunciones.LABEL_IDLINEACATEGORIA: iRow=0; if(!existeFilas) {row = sheet.createRow(iRow);} else {row=sheet.getRow(iRow);} cell = row.createCell(iCell); cell.setCellValue(ProcesoPreciosPorcentajeConstantesFunciones.LABEL_IDLINEACATEGORIA); iRow++; for(ProcesoPreciosPorcentaje procesopreciosporcentaje:procesopreciosporcentajesSeleccionados) { if(!existeFilas) {row = sheet.createRow(iRow);} else {row=sheet.getRow(iRow);} cell = row.createCell(iCell); cell.setCellValue(procesopreciosporcentaje.getlineacategoria_descripcion()); iRow++; } existeFilas=true; iCell++; break; case ProcesoPreciosPorcentajeConstantesFunciones.LABEL_IDLINEAMARCA: iRow=0; if(!existeFilas) {row = sheet.createRow(iRow);} else {row=sheet.getRow(iRow);} cell = row.createCell(iCell); cell.setCellValue(ProcesoPreciosPorcentajeConstantesFunciones.LABEL_IDLINEAMARCA); iRow++; for(ProcesoPreciosPorcentaje procesopreciosporcentaje:procesopreciosporcentajesSeleccionados) { if(!existeFilas) {row = sheet.createRow(iRow);} else {row=sheet.getRow(iRow);} cell = row.createCell(iCell); cell.setCellValue(procesopreciosporcentaje.getlineamarca_descripcion()); iRow++; } existeFilas=true; iCell++; break; case ProcesoPreciosPorcentajeConstantesFunciones.LABEL_CODIGO: iRow=0; if(!existeFilas) {row = sheet.createRow(iRow);} else {row=sheet.getRow(iRow);} cell = row.createCell(iCell); cell.setCellValue(ProcesoPreciosPorcentajeConstantesFunciones.LABEL_CODIGO); iRow++; for(ProcesoPreciosPorcentaje procesopreciosporcentaje:procesopreciosporcentajesSeleccionados) { if(!existeFilas) {row = sheet.createRow(iRow);} else {row=sheet.getRow(iRow);} cell = row.createCell(iCell); cell.setCellValue(procesopreciosporcentaje.getcodigo()); iRow++; } existeFilas=true; iCell++; break; case ProcesoPreciosPorcentajeConstantesFunciones.LABEL_NOMBRE: iRow=0; if(!existeFilas) {row = sheet.createRow(iRow);} else {row=sheet.getRow(iRow);} cell = row.createCell(iCell); cell.setCellValue(ProcesoPreciosPorcentajeConstantesFunciones.LABEL_NOMBRE); iRow++; for(ProcesoPreciosPorcentaje procesopreciosporcentaje:procesopreciosporcentajesSeleccionados) { if(!existeFilas) {row = sheet.createRow(iRow);} else {row=sheet.getRow(iRow);} cell = row.createCell(iCell); cell.setCellValue(procesopreciosporcentaje.getnombre()); iRow++; } existeFilas=true; iCell++; break; case ProcesoPreciosPorcentajeConstantesFunciones.LABEL_CODIGOPRODUCTO: iRow=0; if(!existeFilas) {row = sheet.createRow(iRow);} else {row=sheet.getRow(iRow);} cell = row.createCell(iCell); cell.setCellValue(ProcesoPreciosPorcentajeConstantesFunciones.LABEL_CODIGOPRODUCTO); iRow++; for(ProcesoPreciosPorcentaje procesopreciosporcentaje:procesopreciosporcentajesSeleccionados) { if(!existeFilas) {row = sheet.createRow(iRow);} else {row=sheet.getRow(iRow);} cell = row.createCell(iCell); cell.setCellValue(procesopreciosporcentaje.getcodigo_producto()); iRow++; } existeFilas=true; iCell++; break; case ProcesoPreciosPorcentajeConstantesFunciones.LABEL_NOMBREPRODUCTO: iRow=0; if(!existeFilas) {row = sheet.createRow(iRow);} else {row=sheet.getRow(iRow);} cell = row.createCell(iCell); cell.setCellValue(ProcesoPreciosPorcentajeConstantesFunciones.LABEL_NOMBREPRODUCTO); iRow++; for(ProcesoPreciosPorcentaje procesopreciosporcentaje:procesopreciosporcentajesSeleccionados) { if(!existeFilas) {row = sheet.createRow(iRow);} else {row=sheet.getRow(iRow);} cell = row.createCell(iCell); cell.setCellValue(procesopreciosporcentaje.getnombre_producto()); iRow++; } existeFilas=true; iCell++; break; case ProcesoPreciosPorcentajeConstantesFunciones.LABEL_PRECIO: iRow=0; if(!existeFilas) {row = sheet.createRow(iRow);} else {row=sheet.getRow(iRow);} cell = row.createCell(iCell); cell.setCellValue(ProcesoPreciosPorcentajeConstantesFunciones.LABEL_PRECIO); iRow++; for(ProcesoPreciosPorcentaje procesopreciosporcentaje:procesopreciosporcentajesSeleccionados) { if(!existeFilas) {row = sheet.createRow(iRow);} else {row=sheet.getRow(iRow);} cell = row.createCell(iCell); cell.setCellValue(procesopreciosporcentaje.getprecio()); iRow++; } existeFilas=true; iCell++; break; case ProcesoPreciosPorcentajeConstantesFunciones.LABEL_PORCENTAJE: iRow=0; if(!existeFilas) {row = sheet.createRow(iRow);} else {row=sheet.getRow(iRow);} cell = row.createCell(iCell); cell.setCellValue(ProcesoPreciosPorcentajeConstantesFunciones.LABEL_PORCENTAJE); iRow++; for(ProcesoPreciosPorcentaje procesopreciosporcentaje:procesopreciosporcentajesSeleccionados) { if(!existeFilas) {row = sheet.createRow(iRow);} else {row=sheet.getRow(iRow);} cell = row.createCell(iCell); cell.setCellValue(procesopreciosporcentaje.getporcentaje()); iRow++; } existeFilas=true; iCell++; break; default : break; } } //if(conCabecera) { // this.getFilaCabeceraExportarExcelProcesoPreciosPorcentaje(row); // iRow++; //} //for(ProcesoPreciosPorcentaje procesopreciosporcentajeAux:procesopreciosporcentajesSeleccionados) { // row = sheet.createRow(iRow); // this.getFilaDatosExportarExcelProcesoPreciosPorcentaje(procesopreciosporcentajeAux,row); // iRow++; //} fileOutputStream = new FileOutputStream(new File(sPath)); workbook.write(fileOutputStream); //fileOutputStream.close(); Constantes2.S_PATH_ULTIMO_ARCHIVO=sPath; if(this.parametroGeneralUsuario.getcon_mensaje_confirmacion() && !this.procesopreciosporcentajeSessionBean.getEsGuardarRelacionado()) {//Constantes.ISMOSTRARMENSAJESMANTENIMIENTO && JOptionPane.showMessageDialog(this,"EXPORTADO CORRECTAMENTE:"+sPath,"MANTENIMIENTO DE Proceso Precios Porcentaje",JOptionPane.INFORMATION_MESSAGE); } } catch (Exception e) { throw e; } finally { if (fileOutputStream != null) { fileOutputStream.close(); } } } public void buscarPorId(Long idActual) throws Exception { try { if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.getNewConnexionToDeep(""); } this.idActual=idActual; this.iNumeroPaginacionPagina=0; this.procesarBusqueda("PorId"); //NO FUNCIONA BINDINGS this.inicializarActualizarBindingProcesoPreciosPorcentaje(false); //SI ES MANUAL if(ProcesoPreciosPorcentajeJInternalFrame.ISBINDING_MANUAL) { //this.inicializarActualizarBindingManualProcesoPreciosPorcentaje(); } if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.commitNewConnexionToDeep(); } } catch(Exception e) { if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.rollbackNewConnexionToDeep(); } FuncionesSwing.manageException(this, e,logger); } finally { if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.closeNewConnexionToDeep(); } } } public void jButtonAnterioresProcesoPreciosPorcentajeActionPerformed(ActionEvent evt) throws Exception { try { //this.iNumeroPaginacion-=this.iNumeroPaginacion; /* if(this.iNumeroPaginacion<0) { this.iNumeroPaginacion=0; } */ //this.iNumeroPaginacionPagina=10; if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.getNewConnexionToDeep(""); } this.anteriores(); //NO FUNCIONA BINDINGS this.inicializarActualizarBindingProcesoPreciosPorcentaje(false); //SI ES MANUAL if(ProcesoPreciosPorcentajeJInternalFrame.ISBINDING_MANUAL) { //this.inicializarActualizarBindingManualProcesoPreciosPorcentaje(); } if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.commitNewConnexionToDeep(); } } catch(Exception e) { if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.rollbackNewConnexionToDeep(); } FuncionesSwing.manageException(this, e,logger,ProcesoPreciosPorcentajeConstantesFunciones.CLASSNAME); } finally { if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.closeNewConnexionToDeep(); } } } public void jButtonSiguientesProcesoPreciosPorcentajeActionPerformed(ActionEvent evt) throws Exception { try { //this.iNumeroPaginacion+=this.iNumeroPaginacion; //this.iNumeroPaginacionPagina=10; if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.getNewConnexionToDeep(""); } this.siguientes(); //NO FUNCIONA BINDINGS this.inicializarActualizarBindingProcesoPreciosPorcentaje(false); //SI ES MANUAL if(ProcesoPreciosPorcentajeJInternalFrame.ISBINDING_MANUAL) { //this.inicializarActualizarBindingManualProcesoPreciosPorcentaje(); } if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.commitNewConnexionToDeep(); } } catch(Exception e) { if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.rollbackNewConnexionToDeep(); } FuncionesSwing.manageException(this, e,logger,ProcesoPreciosPorcentajeConstantesFunciones.CLASSNAME); } finally { if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.closeNewConnexionToDeep(); } } } public void aumentarTamanioFilaNuevaTablaProcesoPreciosPorcentaje() throws Exception { Dimension dimensionMinimum=this.jTableDatosProcesoPreciosPorcentaje.getMinimumSize(); Dimension dimensionMaximum=this.jTableDatosProcesoPreciosPorcentaje.getMaximumSize(); Dimension dimensionPreferred=this.jTableDatosProcesoPreciosPorcentaje.getPreferredSize(); double iHeightConFilaNueva=dimensionPreferred.getHeight(); iHeightConFilaNueva+=this.jTableDatosProcesoPreciosPorcentaje.getRowHeight(); dimensionMinimum.setSize(dimensionMinimum.getWidth(),iHeightConFilaNueva); dimensionMaximum.setSize(dimensionMaximum.getWidth(),iHeightConFilaNueva); dimensionPreferred.setSize(dimensionPreferred.getWidth(),iHeightConFilaNueva); this.jTableDatosProcesoPreciosPorcentaje.setMinimumSize(dimensionMinimum); this.jTableDatosProcesoPreciosPorcentaje.setMaximumSize(dimensionMaximum); this.jTableDatosProcesoPreciosPorcentaje.setPreferredSize(dimensionPreferred); } public void inicializarActualizarBindingProcesoPreciosPorcentaje(Boolean esInicializar) throws Exception { this.inicializarActualizarBindingProcesoPreciosPorcentaje(esInicializar,true); } public void inicializarActualizarBindingProcesoPreciosPorcentaje(Boolean esInicializar,Boolean conTabla) throws Exception { if(conTabla) { this.inicializarActualizarBindingTablaProcesoPreciosPorcentaje(esInicializar); } this.inicializarActualizarBindingBotonesProcesoPreciosPorcentaje(esInicializar); //FUNCIONALIDAD_RELACIONADO if(!this.procesopreciosporcentajeSessionBean.getEsGuardarRelacionado()) { try{this.inicializarActualizarBindingBusquedasProcesoPreciosPorcentaje(esInicializar);}catch(Exception e){e.printStackTrace();} //this.inicializarActualizarBindingtiposArchivosReportesAccionesProcesoPreciosPorcentaje(esInicializar) ; this.inicializarActualizarBindingParametrosReportesProcesoPreciosPorcentaje(esInicializar) ; } if(esInicializar) { if( !ProcesoPreciosPorcentajeJInternalFrame.ISBINDING_MANUAL_TABLA || !ProcesoPreciosPorcentajeJInternalFrame.ISBINDING_MANUAL) { } } } public void inicializarActualizarBindingManualProcesoPreciosPorcentaje() throws Exception { //NO SE NECESITA HACER BINDING OTRA VEZ //this.inicializarActualizarBindingTablaProcesoPreciosPorcentaje(); this.inicializarActualizarBindingBotonesManualProcesoPreciosPorcentaje(true); //FUNCIONALIDAD_RELACIONADO if(!this.procesopreciosporcentajeSessionBean.getEsGuardarRelacionado()) { this.inicializarActualizarBindingBusquedasManualProcesoPreciosPorcentaje(); //this.inicializarActualizarBindingtiposArchivosReportesAccionesProcesoPreciosPorcentaje() ; this.inicializarActualizarBindingParametrosReportesPostAccionesManualProcesoPreciosPorcentaje(false) ; } } public void inicializarActualizarBindingParametrosReportesPostAccionesManualProcesoPreciosPorcentaje(Boolean esSetControles) throws Exception { try { if(!esSetControles) { this.isSeleccionarTodos=this.jCheckBoxSeleccionarTodosProcesoPreciosPorcentaje.isSelected(); this.isSeleccionados=this.jCheckBoxSeleccionadosProcesoPreciosPorcentaje.isSelected(); this.conGraficoReporte=this.jCheckBoxConGraficoReporteProcesoPreciosPorcentaje.isSelected(); if(this.jInternalFrameDetalleFormProcesoPreciosPorcentaje!=null) { this.isPostAccionNuevo=this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jCheckBoxPostAccionNuevoProcesoPreciosPorcentaje.isSelected(); this.isPostAccionSinCerrar=this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jCheckBoxPostAccionSinCerrarProcesoPreciosPorcentaje.isSelected(); this.isPostAccionSinMensaje=this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jCheckBoxPostAccionSinMensajeProcesoPreciosPorcentaje.isSelected(); } } else { this.jCheckBoxSeleccionarTodosProcesoPreciosPorcentaje.setSelected(this.isSeleccionarTodos); this.jCheckBoxSeleccionadosProcesoPreciosPorcentaje.setSelected(this.isSeleccionados); this.jCheckBoxConGraficoReporteProcesoPreciosPorcentaje.setSelected(this.conGraficoReporte); if(this.jInternalFrameDetalleFormProcesoPreciosPorcentaje!=null) { this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jCheckBoxPostAccionNuevoProcesoPreciosPorcentaje.setSelected(this.isPostAccionNuevo); this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jCheckBoxPostAccionSinCerrarProcesoPreciosPorcentaje.setSelected(this.isPostAccionSinCerrar); this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jCheckBoxPostAccionSinMensajeProcesoPreciosPorcentaje.setSelected(this.isPostAccionSinMensaje); } } if(this.jComboBoxTiposPaginacionProcesoPreciosPorcentaje.getSelectedItem()!=null) { this.sTipoPaginacion=((Reporte)this.jComboBoxTiposPaginacionProcesoPreciosPorcentaje.getSelectedItem()).getsCodigo(); } if(this.jInternalFrameDetalleFormProcesoPreciosPorcentaje!=null) { this.sTipoAccionFormulario=((Reporte)this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jComboBoxTiposAccionesFormularioProcesoPreciosPorcentaje.getSelectedItem()).getsCodigo(); } if(!this.conCargarMinimo) { this.sTipoArchivoReporte=((Reporte)this.jComboBoxTiposArchivosReportesProcesoPreciosPorcentaje.getSelectedItem()).getsCodigo(); if(this.jInternalFrameReporteDinamicoProcesoPreciosPorcentaje!=null) { this.sTipoArchivoReporteDinamico=((Reporte)this.jInternalFrameReporteDinamicoProcesoPreciosPorcentaje.getjComboBoxTiposArchivosReportesDinamico().getSelectedItem()).getsCodigo(); } this.sTipoRelacion=((Reporte)this.jComboBoxTiposRelacionesProcesoPreciosPorcentaje.getSelectedItem()).getsCodigo(); this.sTipoAccion=((Reporte)this.jComboBoxTiposAccionesProcesoPreciosPorcentaje.getSelectedItem()).getsCodigo(); this.sTipoSeleccionar=((Reporte)this.jComboBoxTiposSeleccionarProcesoPreciosPorcentaje.getSelectedItem()).getsCodigo(); this.sTipoReporte=((Reporte)this.jComboBoxTiposReportesProcesoPreciosPorcentaje.getSelectedItem()).getsCodigo(); if(this.jInternalFrameReporteDinamicoProcesoPreciosPorcentaje!=null) { this.sTipoReporteDinamico=((Reporte)this.jInternalFrameReporteDinamicoProcesoPreciosPorcentaje.getjComboBoxTiposReportesDinamico().getSelectedItem()).getsCodigo(); } this.sTipoGraficoReporte=((Reporte)this.jComboBoxTiposGraficosReportesProcesoPreciosPorcentaje.getSelectedItem()).getsCodigo(); } this.sValorCampoGeneral=this.jTextFieldValorCampoGeneralProcesoPreciosPorcentaje.getText(); } catch(Exception e) { throw e; } } public void inicializarActualizarBindingParametrosReportesProcesoPreciosPorcentaje(Boolean esInicializar) throws Exception { try { if(ProcesoPreciosPorcentajeJInternalFrame.ISBINDING_MANUAL) { this. inicializarActualizarBindingParametrosReportesPostAccionesManualProcesoPreciosPorcentaje(false); } else { } } catch(Exception e) { throw e; } } public void inicializarActualizarBindingtiposArchivosReportesAccionesProcesoPreciosPorcentaje() throws Exception { try { if(ProcesoPreciosPorcentajeJInternalFrame.ISBINDING_MANUAL) { this.inicializarActualizarBindingtiposArchivosReportesAccionesManualProcesoPreciosPorcentaje(); } else { } } catch(Exception e) { throw e; } } @SuppressWarnings("unchecked") public void inicializarActualizarBindingtiposArchivosReportesAccionesManualFormDetalleProcesoPreciosPorcentaje() throws Exception { //TIPOS ACCIONES FORMULARIO this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jComboBoxTiposAccionesFormularioProcesoPreciosPorcentaje.removeAllItems(); for(Reporte reporte:this.tiposAccionesFormulario) { this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jComboBoxTiposAccionesFormularioProcesoPreciosPorcentaje.addItem(reporte); } //TIPOS ACCIONES FORMULARIO } @SuppressWarnings("unchecked") public void inicializarActualizarBindingtiposArchivosReportesAccionesManualProcesoPreciosPorcentaje() throws Exception { try { //TIPOS ARCHIVOS REPORTES this.jComboBoxTiposArchivosReportesProcesoPreciosPorcentaje.removeAllItems(); for(Reporte reporte:this.tiposArchivosReportes) { this.jComboBoxTiposArchivosReportesProcesoPreciosPorcentaje.addItem(reporte); } //TIPOS REPORTES this.jComboBoxTiposReportesProcesoPreciosPorcentaje.removeAllItems(); for(Reporte reporte:this.tiposReportes) { this.jComboBoxTiposReportesProcesoPreciosPorcentaje.addItem(reporte); } //TIPOS GRAFICOS REPORTES this.jComboBoxTiposGraficosReportesProcesoPreciosPorcentaje.removeAllItems(); for(Reporte reporte:this.tiposGraficosReportes) { this.jComboBoxTiposGraficosReportesProcesoPreciosPorcentaje.addItem(reporte); } //TIPOS PAGINACION this.jComboBoxTiposPaginacionProcesoPreciosPorcentaje.removeAllItems(); for(Reporte reporte:this.tiposPaginacion) { this.jComboBoxTiposPaginacionProcesoPreciosPorcentaje.addItem(reporte); } if(!this.procesopreciosporcentajeSessionBean.getEsGuardarRelacionado()) { this.jComboBoxTiposPaginacionProcesoPreciosPorcentaje.setSelectedItem(Funciones2.getTipoPaginacionDefecto("NORMAL",this.tiposPaginacion)); } else { this.jComboBoxTiposPaginacionProcesoPreciosPorcentaje.setSelectedItem(Funciones2.getTipoPaginacionDefecto("RELACIONADO",this.tiposPaginacion)); } //TIPOS ACCIONES this.jComboBoxTiposRelacionesProcesoPreciosPorcentaje.removeAllItems(); for(Reporte reporte:this.tiposRelaciones) { this.jComboBoxTiposRelacionesProcesoPreciosPorcentaje.addItem(reporte); } //TIPOS ACCIONES //TIPOS ACCIONES this.jComboBoxTiposAccionesProcesoPreciosPorcentaje.removeAllItems(); for(Reporte reporte:this.tiposAcciones) { this.jComboBoxTiposAccionesProcesoPreciosPorcentaje.addItem(reporte); } //TIPOS ACCIONES //TIPOS ACCIONES FORMULARIO if(this.jInternalFrameDetalleFormProcesoPreciosPorcentaje!=null) { //if(this.conCargarFormDetalle) { this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jComboBoxTiposAccionesFormularioProcesoPreciosPorcentaje.removeAllItems(); for(Reporte reporte:this.tiposAccionesFormulario) { this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jComboBoxTiposAccionesFormularioProcesoPreciosPorcentaje.addItem(reporte); } } //TIPOS ACCIONES FORMULARIO //TIPOS SELECCIONAR this.jComboBoxTiposSeleccionarProcesoPreciosPorcentaje.removeAllItems(); for(Reporte reporte:this.tiposSeleccionar) { this.jComboBoxTiposSeleccionarProcesoPreciosPorcentaje.addItem(reporte); } if(this.tiposSeleccionar!=null && this.tiposSeleccionar.size()>1) { this.jComboBoxTiposSeleccionarProcesoPreciosPorcentaje.setSelectedIndex(1); } //REPORTE DINAMICO this.inicializarActualizarBindingtiposArchivosReportesDinamicoAccionesManualProcesoPreciosPorcentaje(); //TIPOS COLUMNAS SELECT //TIPOS SELECCIONAR } catch(Exception e) { throw e; } } @SuppressWarnings("unchecked") public void inicializarActualizarBindingtiposArchivosReportesDinamicoAccionesManualProcesoPreciosPorcentaje() throws Exception { try { DefaultListModel<Reporte> defaultListModel=new DefaultListModel<Reporte>(); //TIPOS ARCHIVOS REPORTES DINAMICO if(this.jInternalFrameReporteDinamicoProcesoPreciosPorcentaje!=null) { this.jInternalFrameReporteDinamicoProcesoPreciosPorcentaje.getjComboBoxTiposArchivosReportesDinamico().removeAllItems(); for(Reporte reporte:this.tiposArchivosReportesDinamico) { this.jInternalFrameReporteDinamicoProcesoPreciosPorcentaje.getjComboBoxTiposArchivosReportesDinamico().addItem(reporte); } } //TIPOS REPORTES DINAMICO if(this.jInternalFrameReporteDinamicoProcesoPreciosPorcentaje!=null) { this.jInternalFrameReporteDinamicoProcesoPreciosPorcentaje.getjComboBoxTiposReportesDinamico().removeAllItems(); for(Reporte reporte:this.tiposReportesDinamico) { this.jInternalFrameReporteDinamicoProcesoPreciosPorcentaje.getjComboBoxTiposReportesDinamico().addItem(reporte); } } defaultListModel=new DefaultListModel<Reporte>(); if(this.jInternalFrameReporteDinamicoProcesoPreciosPorcentaje!=null) { if(this.jInternalFrameReporteDinamicoProcesoPreciosPorcentaje.getjListColumnasSelectReporte()!=null) { this.jInternalFrameReporteDinamicoProcesoPreciosPorcentaje.getjListColumnasSelectReporte().removeAll(); for(Reporte reporte:this.tiposColumnasSelect) { defaultListModel.addElement(reporte); } this.jInternalFrameReporteDinamicoProcesoPreciosPorcentaje.getjListColumnasSelectReporte().setModel(defaultListModel); } //TIPOS RELACIONES SELECT //TIPOS SELECCIONAR defaultListModel=new DefaultListModel<Reporte>(); if(this.jInternalFrameReporteDinamicoProcesoPreciosPorcentaje.getjListRelacionesSelectReporte()!=null) { this.jInternalFrameReporteDinamicoProcesoPreciosPorcentaje.getjListRelacionesSelectReporte().removeAll(); for(Reporte reporte:this.tiposRelacionesSelect) { defaultListModel.addElement(reporte); } this.jInternalFrameReporteDinamicoProcesoPreciosPorcentaje.getjListRelacionesSelectReporte().setModel(defaultListModel); } //TIPOS COLUMNAS CATEGORIA DINAMICO if(this.jInternalFrameReporteDinamicoProcesoPreciosPorcentaje.getjComboBoxColumnaCategoriaGrafico()!=null) { this.jInternalFrameReporteDinamicoProcesoPreciosPorcentaje.getjComboBoxColumnaCategoriaGrafico().removeAllItems(); ArrayList<Reporte> tiposColumnasCategoria=ProcesoPreciosPorcentajeConstantesFunciones.getTiposSeleccionarProcesoPreciosPorcentaje(true,true,false,true,true); for(Reporte reporte:tiposColumnasCategoria) {//this.tiposSeleccionar this.jInternalFrameReporteDinamicoProcesoPreciosPorcentaje.getjComboBoxColumnaCategoriaGrafico().addItem(reporte); } } //TIPOS COLUMNAS CATEGORIA VALOR DINAMICO if(this.jInternalFrameReporteDinamicoProcesoPreciosPorcentaje.getjComboBoxColumnaCategoriaValor()!=null) { this.jInternalFrameReporteDinamicoProcesoPreciosPorcentaje.getjComboBoxColumnaCategoriaValor().removeAllItems(); ArrayList<Reporte> tiposColumnasCategoriaValor=ProcesoPreciosPorcentajeConstantesFunciones.getTiposSeleccionarProcesoPreciosPorcentaje(false,false,true,false,false); for(Reporte reporte:tiposColumnasCategoriaValor) {//this.tiposSeleccionar this.jInternalFrameReporteDinamicoProcesoPreciosPorcentaje.getjComboBoxColumnaCategoriaValor().addItem(reporte); } } //TIPOS COLUMNAS VALOR defaultListModel=new DefaultListModel<Reporte>(); if(this.jInternalFrameReporteDinamicoProcesoPreciosPorcentaje.getjListColumnasValoresGrafico()!=null) { this.jInternalFrameReporteDinamicoProcesoPreciosPorcentaje.getjListColumnasValoresGrafico().removeAll(); ArrayList<Reporte> tiposColumnasValor=ProcesoPreciosPorcentajeConstantesFunciones.getTiposSeleccionarProcesoPreciosPorcentaje(false,false,true,false,false); for(Reporte reporte:tiposColumnasValor) {//this.tiposSeleccionar defaultListModel.addElement(reporte); } this.jInternalFrameReporteDinamicoProcesoPreciosPorcentaje.getjListColumnasValoresGrafico().setModel(defaultListModel); } //TIPOS GRAFICOS REPORTES DINAMICOS if(this.jInternalFrameReporteDinamicoProcesoPreciosPorcentaje.getjComboBoxTiposGraficosReportesDinamico()!=null) { this.jInternalFrameReporteDinamicoProcesoPreciosPorcentaje.getjComboBoxTiposGraficosReportesDinamico().removeAllItems(); for(Reporte reporte:this.tiposGraficosReportes) { this.jInternalFrameReporteDinamicoProcesoPreciosPorcentaje.getjComboBoxTiposGraficosReportesDinamico().addItem(reporte); } } } } catch(Exception e) { throw e; } } public void inicializarActualizarBindingBusquedasManualProcesoPreciosPorcentaje() throws Exception { //BYDAN_BUSQUEDAS if(this.jComboBoxid_bodegaBusquedaProcesoPreciosPorcentajeProcesoPreciosPorcentaje.getSelectedItem()!=null){this.id_bodegaBusquedaProcesoPreciosPorcentaje=((Bodega)this.jComboBoxid_bodegaBusquedaProcesoPreciosPorcentajeProcesoPreciosPorcentaje.getSelectedItem()).getId();} if(this.jComboBoxid_productoBusquedaProcesoPreciosPorcentajeProcesoPreciosPorcentaje.getSelectedItem()!=null){this.id_productoBusquedaProcesoPreciosPorcentaje=((Producto)this.jComboBoxid_productoBusquedaProcesoPreciosPorcentajeProcesoPreciosPorcentaje.getSelectedItem()).getId();} if(this.jComboBoxid_lineaBusquedaProcesoPreciosPorcentajeProcesoPreciosPorcentaje.getSelectedItem()!=null){this.id_lineaBusquedaProcesoPreciosPorcentaje=((Linea)this.jComboBoxid_lineaBusquedaProcesoPreciosPorcentajeProcesoPreciosPorcentaje.getSelectedItem()).getId();} if(this.jComboBoxid_linea_grupoBusquedaProcesoPreciosPorcentajeProcesoPreciosPorcentaje.getSelectedItem()!=null){this.id_linea_grupoBusquedaProcesoPreciosPorcentaje=((Linea)this.jComboBoxid_linea_grupoBusquedaProcesoPreciosPorcentajeProcesoPreciosPorcentaje.getSelectedItem()).getId();} if(this.jComboBoxid_linea_categoriaBusquedaProcesoPreciosPorcentajeProcesoPreciosPorcentaje.getSelectedItem()!=null){this.id_linea_categoriaBusquedaProcesoPreciosPorcentaje=((Linea)this.jComboBoxid_linea_categoriaBusquedaProcesoPreciosPorcentajeProcesoPreciosPorcentaje.getSelectedItem()).getId();} if(this.jComboBoxid_linea_marcaBusquedaProcesoPreciosPorcentajeProcesoPreciosPorcentaje.getSelectedItem()!=null){this.id_linea_marcaBusquedaProcesoPreciosPorcentaje=((Linea)this.jComboBoxid_linea_marcaBusquedaProcesoPreciosPorcentajeProcesoPreciosPorcentaje.getSelectedItem()).getId();} } public void inicializarActualizarBindingBusquedasProcesoPreciosPorcentaje(Boolean esInicializar) throws Exception { if(ProcesoPreciosPorcentajeJInternalFrame.ISBINDING_MANUAL) { this.inicializarActualizarBindingBusquedasManualProcesoPreciosPorcentaje(); } else { } } public void inicializarActualizarBindingTablaProcesoPreciosPorcentaje() throws Exception { this.inicializarActualizarBindingTablaProcesoPreciosPorcentaje(false); } public void inicializarActualizarBindingTablaOrderByProcesoPreciosPorcentaje() { //TABLA OrderBy TableColumn tableColumn=new TableColumn(); Integer iWidthTableDefinicionOrderBy=0; this.jInternalFrameOrderByProcesoPreciosPorcentaje.getjTableDatosOrderBy().setModel(new TablaGeneralOrderByModel(this.arrOrderBy)); //DEFINIR RENDERERS OrderBy tableColumn=this.jInternalFrameOrderByProcesoPreciosPorcentaje.getjTableDatosOrderBy().getColumnModel().getColumn(Funciones2.getColumnIndexByName(this.jInternalFrameOrderByProcesoPreciosPorcentaje.getjTableDatosOrderBy(),OrderBy.ISSELECTED)); //tableColumn.addPropertyChangeListener(new ProcesoPreciosPorcentajePropertyChangeListener()); tableColumn.setPreferredWidth(50); tableColumn.setWidth(50); tableColumn.setMinWidth(50); tableColumn.setMaxWidth(50); iWidthTableDefinicionOrderBy+=50; tableColumn=this.jInternalFrameOrderByProcesoPreciosPorcentaje.getjTableDatosOrderBy().getColumnModel().getColumn(Funciones2.getColumnIndexByName(this.jInternalFrameOrderByProcesoPreciosPorcentaje.getjTableDatosOrderBy(),OrderBy.NOMBRE)); //tableColumn.addPropertyChangeListener(new ProcesoPreciosPorcentajePropertyChangeListener()); tableColumn.setPreferredWidth(150); tableColumn.setWidth(150); tableColumn.setMinWidth(150); tableColumn.setMaxWidth(150); iWidthTableDefinicionOrderBy+=150; //tableColumn=this.jTableDatosProcesoPreciosPorcentajeOrderBy.getColumnModel().getColumn(Funciones2.getColumnIndexByName(this.jTableDatosProcesoPreciosPorcentajeOrderBy,OrderBy.NOMBREDB)); ////tableColumn.addPropertyChangeListener(new ProcesoPreciosPorcentajePropertyChangeListener()); tableColumn=this.jInternalFrameOrderByProcesoPreciosPorcentaje.getjTableDatosOrderBy().getColumnModel().getColumn(Funciones2.getColumnIndexByName(this.jInternalFrameOrderByProcesoPreciosPorcentaje.getjTableDatosOrderBy(),OrderBy.ESDESC)); //tableColumn.addPropertyChangeListener(new ProcesoPreciosPorcentajePropertyChangeListener()); tableColumn.setPreferredWidth(50); tableColumn.setWidth(50); tableColumn.setMinWidth(50); tableColumn.setMaxWidth(50); ((AbstractTableModel) this.jInternalFrameOrderByProcesoPreciosPorcentaje.getjTableDatosOrderBy().getModel()).fireTableDataChanged(); iWidthTableDefinicionOrderBy+=50; } public void inicializarActualizarBindingTablaProcesoPreciosPorcentaje(Boolean esInicializar) throws Exception { Boolean isNoExiste=false; Integer iCountNumeroColumnasNormal=0; Integer iCountNumeroColumnasFk=0; this.iWidthTableDefinicion=0; int iSizeTabla=0; iSizeTabla=this.getSizeTablaDatos(); if(esInicializar || ConstantesSwing.FORZAR_INICIALIZAR_TABLA) {//esInicializar //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { isNoExiste=procesopreciosporcentajeLogic.getProcesoPreciosPorcentajes().size()==0; } else if(Constantes.ISUSAEJBREMOTE || Constantes.ISUSAEJBHOME) { isNoExiste=procesopreciosporcentajes.size()==0; } //ARCHITECTURE if(isNoExiste) { if(this.iNumeroPaginacion-this.iNumeroPaginacion>0) { this.iNumeroPaginacion-=this.iNumeroPaginacion; } } TableColumn tableColumn=new TableColumn(); if(ProcesoPreciosPorcentajeJInternalFrame.ISBINDING_MANUAL_TABLA) { //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { this.jTableDatosProcesoPreciosPorcentaje.setModel(new ProcesoPreciosPorcentajeModel(this.procesopreciosporcentajeLogic.getProcesoPreciosPorcentajes(),this)); } else if(Constantes.ISUSAEJBREMOTE || Constantes.ISUSAEJBHOME ) { this.jTableDatosProcesoPreciosPorcentaje.setModel(new ProcesoPreciosPorcentajeModel(this.procesopreciosporcentajes,this)); } //ARCHITECTURE if(this.jInternalFrameOrderByProcesoPreciosPorcentaje!=null && this.jInternalFrameOrderByProcesoPreciosPorcentaje.getjTableDatosOrderBy()!=null) { this.inicializarActualizarBindingTablaOrderByProcesoPreciosPorcentaje(); } //DEFINIR RENDERERS tableColumn=this.jTableDatosProcesoPreciosPorcentaje.getColumnModel().getColumn(Funciones2.getColumnIndexByName(this.jTableDatosProcesoPreciosPorcentaje,Constantes2.S_SELECCIONAR)); //tableColumn.addPropertyChangeListener(new ProcesoPreciosPorcentajePropertyChangeListener()); tableColumn.setCellRenderer(new BooleanRenderer(true,"Seleccionar "+ProcesoPreciosPorcentajeConstantesFunciones.SCLASSWEBTITULO,procesopreciosporcentajeConstantesFunciones.resaltarSeleccionarProcesoPreciosPorcentaje,iSizeTabla,true,false,"","",this)); tableColumn.setCellEditor(new BooleanEditorRenderer(true,"Seleccionar "+ProcesoPreciosPorcentajeConstantesFunciones.SCLASSWEBTITULO,procesopreciosporcentajeConstantesFunciones.resaltarSeleccionarProcesoPreciosPorcentaje,false,"","",this)); tableColumn.setPreferredWidth(50); tableColumn.setWidth(50); tableColumn.setMinWidth(50); tableColumn.setMaxWidth(50); this.iWidthTableDefinicion+=50; tableColumn=this.jTableDatosProcesoPreciosPorcentaje.getColumnModel().getColumn(Funciones2.getColumnIndexByName(this.jTableDatosProcesoPreciosPorcentaje,ProcesoPreciosPorcentajeConstantesFunciones.LABEL_ID)); if(this.procesopreciosporcentajeConstantesFunciones.mostraridProcesoPreciosPorcentaje && Funciones2.permiteMostarParaBusqueda(this.esParaBusquedaForeignKey,ProcesoPreciosPorcentajeConstantesFunciones.LABEL_ID,false,iCountNumeroColumnasNormal++,iCountNumeroColumnasFk)) { tableColumn.setCellRenderer(new TextFieldRenderer(this.procesopreciosporcentajeConstantesFunciones.resaltaridProcesoPreciosPorcentaje,this.procesopreciosporcentajeConstantesFunciones.activaridProcesoPreciosPorcentaje,iSizeTabla,this,true,"idProcesoPreciosPorcentaje","BASICO")); tableColumn.setCellEditor(new TextFieldEditorRenderer(this.procesopreciosporcentajeConstantesFunciones.resaltaridProcesoPreciosPorcentaje,this.procesopreciosporcentajeConstantesFunciones.activaridProcesoPreciosPorcentaje,this,true,"idProcesoPreciosPorcentaje","BASICO",false)); tableColumn.setPreferredWidth(50); tableColumn.setWidth(50); tableColumn.setMinWidth(50); tableColumn.setMaxWidth(50); this.iWidthTableDefinicion+=50; } else { Funciones2.setTableColumnOcultar(tableColumn); } tableColumn=this.jTableDatosProcesoPreciosPorcentaje.getColumnModel().getColumn(Funciones2.getColumnIndexByName(this.jTableDatosProcesoPreciosPorcentaje,ProcesoPreciosPorcentajeConstantesFunciones.LABEL_CODIGO)); if(this.procesopreciosporcentajeConstantesFunciones.mostrarcodigoProcesoPreciosPorcentaje && Funciones2.permiteMostarParaBusqueda(this.esParaBusquedaForeignKey,ProcesoPreciosPorcentajeConstantesFunciones.LABEL_CODIGO,false,iCountNumeroColumnasNormal++,iCountNumeroColumnasFk)) { tableColumn.setCellRenderer(new LabelRenderer(this.procesopreciosporcentajeConstantesFunciones.resaltarcodigoProcesoPreciosPorcentaje,this.procesopreciosporcentajeConstantesFunciones.activarcodigoProcesoPreciosPorcentaje,iSizeTabla,this,true,"codigoProcesoPreciosPorcentaje","BASICO")); tableColumn.setCellEditor(new TextFieldEditorRenderer(this.procesopreciosporcentajeConstantesFunciones.resaltarcodigoProcesoPreciosPorcentaje,this.procesopreciosporcentajeConstantesFunciones.activarcodigoProcesoPreciosPorcentaje,this,true,"codigoProcesoPreciosPorcentaje","BASICO",false)); tableColumn.setPreferredWidth(Constantes.ISWING_ANCHO_COLUMNA + FuncionesSwing.getValorProporcion(Constantes.ISWING_ANCHO_CONTROL,0)); tableColumn.setWidth(Constantes.ISWING_ANCHO_COLUMNA + FuncionesSwing.getValorProporcion(Constantes.ISWING_ANCHO_CONTROL,0)); tableColumn.setMinWidth(Constantes.ISWING_ANCHO_COLUMNA + FuncionesSwing.getValorProporcion(Constantes.ISWING_ANCHO_CONTROL,0)); tableColumn.setMaxWidth(Constantes.ISWING_ANCHO_COLUMNA + FuncionesSwing.getValorProporcion(Constantes.ISWING_ANCHO_CONTROL,0)); this.iWidthTableDefinicion+=Constantes.ISWING_ANCHO_COLUMNA + FuncionesSwing.getValorProporcion(Constantes.ISWING_ANCHO_CONTROL,0); //tableColumn.addPropertyChangeListener(new ProcesoPreciosPorcentajePropertyChangeListener()); } else { Funciones2.setTableColumnOcultar(tableColumn); } tableColumn=this.jTableDatosProcesoPreciosPorcentaje.getColumnModel().getColumn(Funciones2.getColumnIndexByName(this.jTableDatosProcesoPreciosPorcentaje,ProcesoPreciosPorcentajeConstantesFunciones.LABEL_NOMBRE)); if(this.procesopreciosporcentajeConstantesFunciones.mostrarnombreProcesoPreciosPorcentaje && Funciones2.permiteMostarParaBusqueda(this.esParaBusquedaForeignKey,ProcesoPreciosPorcentajeConstantesFunciones.LABEL_NOMBRE,false,iCountNumeroColumnasNormal++,iCountNumeroColumnasFk)) { tableColumn.setCellRenderer(new LabelRenderer(this.procesopreciosporcentajeConstantesFunciones.resaltarnombreProcesoPreciosPorcentaje,this.procesopreciosporcentajeConstantesFunciones.activarnombreProcesoPreciosPorcentaje,iSizeTabla,this,true,"nombreProcesoPreciosPorcentaje","BASICO")); tableColumn.setCellEditor(new TextFieldEditorRenderer(this.procesopreciosporcentajeConstantesFunciones.resaltarnombreProcesoPreciosPorcentaje,this.procesopreciosporcentajeConstantesFunciones.activarnombreProcesoPreciosPorcentaje,this,true,"nombreProcesoPreciosPorcentaje","BASICO",false)); tableColumn.setPreferredWidth(Constantes.ISWING_ANCHO_COLUMNA + FuncionesSwing.getValorProporcion(Constantes.ISWING_ANCHO_CONTROL,0)); tableColumn.setWidth(Constantes.ISWING_ANCHO_COLUMNA + FuncionesSwing.getValorProporcion(Constantes.ISWING_ANCHO_CONTROL,0)); tableColumn.setMinWidth(Constantes.ISWING_ANCHO_COLUMNA + FuncionesSwing.getValorProporcion(Constantes.ISWING_ANCHO_CONTROL,0)); tableColumn.setMaxWidth(Constantes.ISWING_ANCHO_COLUMNA + FuncionesSwing.getValorProporcion(Constantes.ISWING_ANCHO_CONTROL,0)); this.iWidthTableDefinicion+=Constantes.ISWING_ANCHO_COLUMNA + FuncionesSwing.getValorProporcion(Constantes.ISWING_ANCHO_CONTROL,0); //tableColumn.addPropertyChangeListener(new ProcesoPreciosPorcentajePropertyChangeListener()); } else { Funciones2.setTableColumnOcultar(tableColumn); } tableColumn=this.jTableDatosProcesoPreciosPorcentaje.getColumnModel().getColumn(Funciones2.getColumnIndexByName(this.jTableDatosProcesoPreciosPorcentaje,ProcesoPreciosPorcentajeConstantesFunciones.LABEL_CODIGOPRODUCTO)); if(this.procesopreciosporcentajeConstantesFunciones.mostrarcodigo_productoProcesoPreciosPorcentaje && Funciones2.permiteMostarParaBusqueda(this.esParaBusquedaForeignKey,ProcesoPreciosPorcentajeConstantesFunciones.LABEL_CODIGOPRODUCTO,false,iCountNumeroColumnasNormal++,iCountNumeroColumnasFk)) { tableColumn.setCellRenderer(new LabelRenderer(this.procesopreciosporcentajeConstantesFunciones.resaltarcodigo_productoProcesoPreciosPorcentaje,this.procesopreciosporcentajeConstantesFunciones.activarcodigo_productoProcesoPreciosPorcentaje,iSizeTabla,this,true,"codigo_productoProcesoPreciosPorcentaje","BASICO")); tableColumn.setCellEditor(new TextFieldEditorRenderer(this.procesopreciosporcentajeConstantesFunciones.resaltarcodigo_productoProcesoPreciosPorcentaje,this.procesopreciosporcentajeConstantesFunciones.activarcodigo_productoProcesoPreciosPorcentaje,this,true,"codigo_productoProcesoPreciosPorcentaje","BASICO",false)); tableColumn.setPreferredWidth(Constantes.ISWING_ANCHO_COLUMNA + FuncionesSwing.getValorProporcion(Constantes.ISWING_ANCHO_CONTROL,0)); tableColumn.setWidth(Constantes.ISWING_ANCHO_COLUMNA + FuncionesSwing.getValorProporcion(Constantes.ISWING_ANCHO_CONTROL,0)); tableColumn.setMinWidth(Constantes.ISWING_ANCHO_COLUMNA + FuncionesSwing.getValorProporcion(Constantes.ISWING_ANCHO_CONTROL,0)); tableColumn.setMaxWidth(Constantes.ISWING_ANCHO_COLUMNA + FuncionesSwing.getValorProporcion(Constantes.ISWING_ANCHO_CONTROL,0)); this.iWidthTableDefinicion+=Constantes.ISWING_ANCHO_COLUMNA + FuncionesSwing.getValorProporcion(Constantes.ISWING_ANCHO_CONTROL,0); //tableColumn.addPropertyChangeListener(new ProcesoPreciosPorcentajePropertyChangeListener()); } else { Funciones2.setTableColumnOcultar(tableColumn); } tableColumn=this.jTableDatosProcesoPreciosPorcentaje.getColumnModel().getColumn(Funciones2.getColumnIndexByName(this.jTableDatosProcesoPreciosPorcentaje,ProcesoPreciosPorcentajeConstantesFunciones.LABEL_NOMBREPRODUCTO)); if(this.procesopreciosporcentajeConstantesFunciones.mostrarnombre_productoProcesoPreciosPorcentaje && Funciones2.permiteMostarParaBusqueda(this.esParaBusquedaForeignKey,ProcesoPreciosPorcentajeConstantesFunciones.LABEL_NOMBREPRODUCTO,false,iCountNumeroColumnasNormal++,iCountNumeroColumnasFk)) { tableColumn.setCellRenderer(new LabelRenderer(this.procesopreciosporcentajeConstantesFunciones.resaltarnombre_productoProcesoPreciosPorcentaje,this.procesopreciosporcentajeConstantesFunciones.activarnombre_productoProcesoPreciosPorcentaje,iSizeTabla,this,true,"nombre_productoProcesoPreciosPorcentaje","BASICO")); tableColumn.setCellEditor(new TextFieldEditorRenderer(this.procesopreciosporcentajeConstantesFunciones.resaltarnombre_productoProcesoPreciosPorcentaje,this.procesopreciosporcentajeConstantesFunciones.activarnombre_productoProcesoPreciosPorcentaje,this,true,"nombre_productoProcesoPreciosPorcentaje","BASICO",false)); tableColumn.setPreferredWidth(Constantes.ISWING_ANCHO_COLUMNA + FuncionesSwing.getValorProporcion(Constantes.ISWING_ANCHO_CONTROL,0)); tableColumn.setWidth(Constantes.ISWING_ANCHO_COLUMNA + FuncionesSwing.getValorProporcion(Constantes.ISWING_ANCHO_CONTROL,0)); tableColumn.setMinWidth(Constantes.ISWING_ANCHO_COLUMNA + FuncionesSwing.getValorProporcion(Constantes.ISWING_ANCHO_CONTROL,0)); tableColumn.setMaxWidth(Constantes.ISWING_ANCHO_COLUMNA + FuncionesSwing.getValorProporcion(Constantes.ISWING_ANCHO_CONTROL,0)); this.iWidthTableDefinicion+=Constantes.ISWING_ANCHO_COLUMNA + FuncionesSwing.getValorProporcion(Constantes.ISWING_ANCHO_CONTROL,0); //tableColumn.addPropertyChangeListener(new ProcesoPreciosPorcentajePropertyChangeListener()); } else { Funciones2.setTableColumnOcultar(tableColumn); } tableColumn=this.jTableDatosProcesoPreciosPorcentaje.getColumnModel().getColumn(Funciones2.getColumnIndexByName(this.jTableDatosProcesoPreciosPorcentaje,ProcesoPreciosPorcentajeConstantesFunciones.LABEL_PRECIO)); if(this.procesopreciosporcentajeConstantesFunciones.mostrarprecioProcesoPreciosPorcentaje && Funciones2.permiteMostarParaBusqueda(this.esParaBusquedaForeignKey,ProcesoPreciosPorcentajeConstantesFunciones.LABEL_PRECIO,false,iCountNumeroColumnasNormal++,iCountNumeroColumnasFk)) { tableColumn.setCellRenderer(new TextFieldRenderer(this.procesopreciosporcentajeConstantesFunciones.resaltarprecioProcesoPreciosPorcentaje,this.procesopreciosporcentajeConstantesFunciones.activarprecioProcesoPreciosPorcentaje,iSizeTabla,this,true,"precioProcesoPreciosPorcentaje","BASICO")); tableColumn.setCellEditor(new TextFieldEditorRenderer(this.procesopreciosporcentajeConstantesFunciones.resaltarprecioProcesoPreciosPorcentaje,this.procesopreciosporcentajeConstantesFunciones.activarprecioProcesoPreciosPorcentaje,this,true,"precioProcesoPreciosPorcentaje","BASICO",false)); tableColumn.setPreferredWidth(Constantes.ISWING_ANCHO_COLUMNA); tableColumn.setWidth(Constantes.ISWING_ANCHO_COLUMNA); tableColumn.setMinWidth(Constantes.ISWING_ANCHO_COLUMNA); tableColumn.setMaxWidth(Constantes.ISWING_ANCHO_COLUMNA); this.iWidthTableDefinicion+=Constantes.ISWING_ANCHO_COLUMNA; //tableColumn.addPropertyChangeListener(new ProcesoPreciosPorcentajePropertyChangeListener()); } else { Funciones2.setTableColumnOcultar(tableColumn); } tableColumn=this.jTableDatosProcesoPreciosPorcentaje.getColumnModel().getColumn(Funciones2.getColumnIndexByName(this.jTableDatosProcesoPreciosPorcentaje,ProcesoPreciosPorcentajeConstantesFunciones.LABEL_PORCENTAJE)); if(this.procesopreciosporcentajeConstantesFunciones.mostrarporcentajeProcesoPreciosPorcentaje && Funciones2.permiteMostarParaBusqueda(this.esParaBusquedaForeignKey,ProcesoPreciosPorcentajeConstantesFunciones.LABEL_PORCENTAJE,false,iCountNumeroColumnasNormal++,iCountNumeroColumnasFk)) { tableColumn.setCellRenderer(new TextFieldRenderer(this.procesopreciosporcentajeConstantesFunciones.resaltarporcentajeProcesoPreciosPorcentaje,this.procesopreciosporcentajeConstantesFunciones.activarporcentajeProcesoPreciosPorcentaje,iSizeTabla,this,true,"porcentajeProcesoPreciosPorcentaje","BASICO")); tableColumn.setCellEditor(new TextFieldEditorRenderer(this.procesopreciosporcentajeConstantesFunciones.resaltarporcentajeProcesoPreciosPorcentaje,this.procesopreciosporcentajeConstantesFunciones.activarporcentajeProcesoPreciosPorcentaje,this,true,"porcentajeProcesoPreciosPorcentaje","BASICO",false)); tableColumn.setPreferredWidth(Constantes.ISWING_ANCHO_COLUMNA); tableColumn.setWidth(Constantes.ISWING_ANCHO_COLUMNA); tableColumn.setMinWidth(Constantes.ISWING_ANCHO_COLUMNA); tableColumn.setMaxWidth(Constantes.ISWING_ANCHO_COLUMNA); this.iWidthTableDefinicion+=Constantes.ISWING_ANCHO_COLUMNA; //tableColumn.addPropertyChangeListener(new ProcesoPreciosPorcentajePropertyChangeListener()); } else { Funciones2.setTableColumnOcultar(tableColumn); } } else { } if(!this.procesopreciosporcentajeSessionBean.getEsGuardarRelacionado() && !this.esParaBusquedaForeignKey) { } if(true) { String sLabelColumnAccion="Editar"; String sLabelColumnAccionEli="Eli"; if(this.esParaBusquedaForeignKey) { sLabelColumnAccion="Seleccionar"; //LO MISMO QUE ELSE tableColumn= new TableColumn(); tableColumn.setIdentifier(sLabelColumnAccion); tableColumn.setHeaderValue(sLabelColumnAccion); tableColumn.setCellRenderer(new IdTableCell(this,false,false,this.procesopreciosporcentajeSessionBean.getEsGuardarRelacionado(),iSizeTabla)); tableColumn.setCellEditor(new IdTableCell(this,false,false,this.procesopreciosporcentajeSessionBean.getEsGuardarRelacionado(),iSizeTabla)); tableColumn.setPreferredWidth(Constantes.ISWING_ANCHO_COLUMNA); tableColumn.setWidth(Constantes.ISWING_ANCHO_COLUMNA); tableColumn.setMinWidth(Constantes.ISWING_ANCHO_COLUMNA); tableColumn.setMaxWidth(Constantes.ISWING_ANCHO_COLUMNA); this.iWidthTableDefinicion+=Constantes.ISWING_ANCHO_COLUMNA; this.jTableDatosProcesoPreciosPorcentaje.addColumn(tableColumn); } else { //LO MISMO QUE IF tableColumn= new TableColumn(); tableColumn.setIdentifier(sLabelColumnAccion); tableColumn.setHeaderValue(sLabelColumnAccion); tableColumn.setCellRenderer(new IdTableCell(this,false,false,this.procesopreciosporcentajeSessionBean.getEsGuardarRelacionado(),iSizeTabla)); tableColumn.setCellEditor(new IdTableCell(this,false,false,this.procesopreciosporcentajeSessionBean.getEsGuardarRelacionado(),iSizeTabla)); tableColumn.setPreferredWidth(Constantes.ISWING_ANCHO_COLUMNA); tableColumn.setWidth(Constantes.ISWING_ANCHO_COLUMNA); tableColumn.setMinWidth(Constantes.ISWING_ANCHO_COLUMNA); tableColumn.setMaxWidth(Constantes.ISWING_ANCHO_COLUMNA); this.iWidthTableDefinicion+=Constantes.ISWING_ANCHO_COLUMNA; this.jTableDatosProcesoPreciosPorcentaje.addColumn(tableColumn); //ELIMINAR if(this.isPermisoEliminarProcesoPreciosPorcentaje && this.isPermisoGuardarCambiosProcesoPreciosPorcentaje) { tableColumn= new TableColumn(); tableColumn.setIdentifier(Constantes2.S_ELI); tableColumn.setHeaderValue(sLabelColumnAccionEli); tableColumn.setCellRenderer(new IdTableCell(this,false,true,this.procesopreciosporcentajeSessionBean.getEsGuardarRelacionado(),iSizeTabla)); tableColumn.setCellEditor(new IdTableCell(this,false,true,this.procesopreciosporcentajeSessionBean.getEsGuardarRelacionado(),iSizeTabla)); tableColumn.setPreferredWidth(65); tableColumn.setWidth(65); tableColumn.setMinWidth(65); tableColumn.setMaxWidth(65); this.iWidthTableDefinicion+=65; this.jTableDatosProcesoPreciosPorcentaje.addColumn(tableColumn); } } /* tableColumn= new TableColumn(); tableColumn.setIdentifier(Constantes2.S_SELECCIONAR); tableColumn.setHeaderValue(Constantes2.S_SELECCIONAR); tableColumn.setCellRenderer(new IdSeleccionarTableCell(this)); tableColumn.setCellEditor(new IdSeleccionarTableCell(this)); tableColumn.setPreferredWidth(30); tableColumn.setWidth(30); tableColumn.setMinWidth(30); this.iWidthTableDefinicion+=30; this.jTableDatosProcesoPreciosPorcentaje.addColumn(tableColumn); */ } Integer iUltimaColumna=0;//1 Integer iNuevaPosicionColumna=0; //PERMITE ELIMINAR SIMPLE if(!this.esParaBusquedaForeignKey) { if(this.isPermisoEliminarProcesoPreciosPorcentaje && this.isPermisoGuardarCambiosProcesoPreciosPorcentaje) { iUltimaColumna++; } } //PERMITE EDITAR SIMPLE iUltimaColumna++; //MOVIA SELECCIONAR //iUltimaColumna++; if(!this.esParaBusquedaForeignKey) { if(this.isPermisoEliminarProcesoPreciosPorcentaje && this.isPermisoGuardarCambiosProcesoPreciosPorcentaje) { //REUBICA ELIMINAR SIMPLE jTableDatosProcesoPreciosPorcentaje.moveColumn(this.jTableDatosProcesoPreciosPorcentaje.getColumnModel().getColumnCount()-iUltimaColumna, iNuevaPosicionColumna++);//-1,-2 o -3 iUltimaColumna--; } } //REUBICA EDITAR SIMPLE jTableDatosProcesoPreciosPorcentaje.moveColumn(this.jTableDatosProcesoPreciosPorcentaje.getColumnModel().getColumnCount()-iUltimaColumna, iNuevaPosicionColumna++);//-1,-2 o -3 //REUBICABA SELECCIONAR /* if(iUltimaColumna>1) { iUltimaColumna--; } //iNuevaPosicionColumna++; //REUBICA SELECCIONAR FILA CHECK jTableDatosProcesoPreciosPorcentaje.moveColumn(this.jTableDatosProcesoPreciosPorcentaje.getColumnModel().getColumnCount()-iUltimaColumna, iNuevaPosicionColumna++);//-1 */ //DEFINEN HEADERS final TableCellRenderer tableHeaderDefaultCellRenderer = this.jTableDatosProcesoPreciosPorcentaje.getTableHeader().getDefaultRenderer(); this.jTableDatosProcesoPreciosPorcentaje.getTableHeader().setDefaultRenderer(new TableCellRendererHeader(this.jTableDatosProcesoPreciosPorcentaje,tableHeaderDefaultCellRenderer)); TableColumn column=null; if(!ProcesoPreciosPorcentajeJInternalFrame.ISBINDING_MANUAL_TABLA) { for(int i = 0; i < this.jTableDatosProcesoPreciosPorcentaje.getColumnModel().getColumnCount(); i++) { column = this.jTableDatosProcesoPreciosPorcentaje.getColumnModel().getColumn(i); if(column.getIdentifier()!=null) { //SI SE UTILIZA UN HEADER ES GENERICO //column.setHeaderRenderer(new HeaderRenderer(column.getIdentifier().toString())); } if(column.getIdentifier()!=null && column.getIdentifier().equals(Constantes2.S_ELI)) { continue; } if(column.getIdentifier()!=null && column.getIdentifier().equals(Constantes2.S_SELECCIONAR)) { if(!ProcesoPreciosPorcentajeJInternalFrame.ISBINDING_MANUAL_TABLA) { column.setPreferredWidth(50); column.setWidth(50); column.setMinWidth(50); column.setMaxWidth(50); this.iWidthTableDefinicion+=50; } } else { if(!ProcesoPreciosPorcentajeJInternalFrame.ISBINDING_MANUAL_TABLA) { column.setPreferredWidth(Constantes.ISWING_ANCHO_COLUMNA); column.setWidth(Constantes.ISWING_ANCHO_COLUMNA); column.setMinWidth(Constantes.ISWING_ANCHO_COLUMNA); column.setMaxWidth(Constantes.ISWING_ANCHO_COLUMNA); this.iWidthTableDefinicion+=Constantes.ISWING_ANCHO_COLUMNA; } } } } this.jTableDatosProcesoPreciosPorcentaje.setSelectionBackground(FuncionesSwing.getColorSelectedBackground()); this.jTableDatosProcesoPreciosPorcentaje.setSelectionForeground(FuncionesSwing.getColorSelectedForeground()); /* this.jTableDatosProcesoPreciosPorcentaje.setDefaultRenderer(Object.class, new DefaultTableCellRenderer() { private static final long serialVersionUID = 1L; @Override public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { final Component component= super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column); //POR DEFECTO ES MEJOR, SE PIERDE DATOS AL SELECCIONAR BLANCO LETRAS BLANCAS component.setBackground(row % 2 == 0 ? FuncionesSwing.getColorTextFields(Constantes2.S_FONDOCONTROL_COLOR) : Funciones2.getColorFilaTabla2()); //FuncionesSwing.getColorTextFields(Constantes2.S_FONDOCONTROL_COLOR) component.setForeground(Funciones2.getColorTextoFilaTabla1()); try { int iSize=-999; if(conTotales) { //FILA TOTALES OTRO COLOR, SI TABLA NO ES UNO A UNO if(Constantes.ISUSAEJBLOGICLAYER) { //iSize=procesopreciosporcentajeLogic.getProcesoPreciosPorcentajes().size()-1; } else if(Constantes.ISUSAEJBREMOTE || Constantes.ISUSAEJBHOME) { iSize=procesopreciosporcentajes.size()-1; } if(iSize==row) { component.setBackground(Funciones2.getColorFilaTablaTotales()); } } //POR EFICIENCIA NO UTILIZAR //if (component instanceof JComponent) { // JComponent jcomponent = (JComponent) component; //} } catch (Exception e) { e.printStackTrace(); } return component; } }); */ //ESTA EN LA DEFINICION DE LA TABLA //this.jTableDatosProcesoPreciosPorcentaje.setRowHeight(Constantes.ISWING_ALTO_FILA_TABLA); /* column=this.jTableDatosProcesoPreciosPorcentaje.getColumnModel().getColumn(Funciones2.getColumnIndexByName(this.jTableDatosSistema,Constantes2.S_SELECCIONAR)); if(column!=null) { column.setPreferredWidth(25); column.setWidth(25); column.setMinWidth(25); } */ //CopyTableToTableTotal(); } else { this.actualizarVisualTableDatosProcesoPreciosPorcentaje(); } } /* //COPY_TABLES /* FALTARIA RESOLVER: 1 SOLO SCROLL PARA 2 TABLAS COPIA EXACTA DE COLUMNAS DE UNA TABLA A OTRA, SI SE MODIFICA TAMANIO TAMBIEN LA OTRA */ public void jButtonIdActionPerformed(ActionEvent evt,int rowIndex,Boolean esRelaciones,Boolean esEliminar) { try { if(!esEliminar) { this.estaModoSeleccionar=true; //this.isEsNuevoProcesoPreciosPorcentaje=false; ProcesoPreciosPorcentajeBeanSwingJInternalFrameAdditional.procesarEventosVista(this.parametroGeneralUsuario,this.moduloActual,this.opcionActual,this.usuarioActual,this,FuncionTipo.BEFORE,ControlTipo.FORM,EventoTipo.LOAD,EventoSubTipo.SELECTED,"FORM",this.procesopreciosporcentaje,new Object(),this.procesopreciosporcentajeParameterGeneral,this.procesopreciosporcentajeReturnGeneral); if(this.procesopreciosporcentajeSessionBean.getConGuardarRelaciones()) { this.dStart=(double)System.currentTimeMillis(); } if(this.jInternalFrameDetalleFormProcesoPreciosPorcentaje==null) { this.inicializarFormDetalle(); } this.inicializarInvalidValues(); int intSelectedRow = 0; if(rowIndex>=0) { intSelectedRow=rowIndex; this.jTableDatosProcesoPreciosPorcentaje.getSelectionModel().setSelectionInterval(intSelectedRow, intSelectedRow); } else { intSelectedRow=this.jTableDatosProcesoPreciosPorcentaje.getSelectedRow(); } //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentaje =(ProcesoPreciosPorcentaje) this.procesopreciosporcentajeLogic.getProcesoPreciosPorcentajes().toArray()[this.jTableDatosProcesoPreciosPorcentaje.convertRowIndexToModel(intSelectedRow)]; } else if(Constantes.ISUSAEJBREMOTE || Constantes.ISUSAEJBHOME ) { this.procesopreciosporcentaje =(ProcesoPreciosPorcentaje) this.procesopreciosporcentajes.toArray()[this.jTableDatosProcesoPreciosPorcentaje.convertRowIndexToModel(intSelectedRow)]; } //ARCHITECTURE //PUEDE SER PARA DUPLICADO O NUEVO TABLA if(this.procesopreciosporcentaje.getsType().equals("DUPLICADO") || this.procesopreciosporcentaje.getsType().equals("NUEVO_GUARDAR_CAMBIOS")) { this.isEsNuevoProcesoPreciosPorcentaje=true; } else { this.isEsNuevoProcesoPreciosPorcentaje=false; } //CONTROL VERSION ANTERIOR /* if(!this.procesopreciosporcentajeSessionBean.getEsGuardarRelacionado()) { if(this.procesopreciosporcentaje.getId()>=0 && !this.procesopreciosporcentaje.getIsNew()) { this.isEsNuevoProcesoPreciosPorcentaje=false; } else { this.isEsNuevoProcesoPreciosPorcentaje=true; } } else { //CONTROLAR PARA RELACIONADO } */ //ESTABLECE SI ES RELACIONADO O NO this.habilitarDeshabilitarTipoMantenimientoProcesoPreciosPorcentaje(esRelaciones); this.seleccionarProcesoPreciosPorcentaje(evt,null,rowIndex); //SELECCIONA ACTUAL PERO AUN NO SE HA INGRESADO AL SISTEMA //SE DESHABILITA POR GUARDAR CAMBIOS /* if(this.procesopreciosporcentaje.getId()<0) { this.isEsNuevoProcesoPreciosPorcentaje=true; } */ if(!this.esParaBusquedaForeignKey) { this.modificarProcesoPreciosPorcentaje(evt,rowIndex,esRelaciones); } else { this.seleccionarProcesoPreciosPorcentaje(evt,rowIndex); } if(this.procesopreciosporcentajeSessionBean.getConGuardarRelaciones()) { this.dEnd=(double)System.currentTimeMillis(); this.dDif=this.dEnd - this.dStart; if(Constantes.ISDEVELOPING) { System.out.println("Tiempo(ms) Seleccion ProcesoPreciosPorcentaje: " + this.dDif); } } ProcesoPreciosPorcentajeBeanSwingJInternalFrameAdditional.procesarEventosVista(this.parametroGeneralUsuario,this.moduloActual,this.opcionActual,this.usuarioActual,this,FuncionTipo.AFTER,ControlTipo.FORM,EventoTipo.LOAD,EventoSubTipo.SELECTED,"FORM",this.procesopreciosporcentaje,new Object(),this.procesopreciosporcentajeParameterGeneral,this.procesopreciosporcentajeReturnGeneral); } else { this.estaModoEliminarGuardarCambios=true; this.seleccionarProcesoPreciosPorcentaje(evt,null,rowIndex); if(this.permiteMantenimiento(this.procesopreciosporcentaje)) { if(this.procesopreciosporcentaje.getId()>0) { this.procesopreciosporcentaje.setIsDeleted(true); this.procesopreciosporcentajesEliminados.add(this.procesopreciosporcentaje); } if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.getProcesoPreciosPorcentajes().remove(this.procesopreciosporcentaje); } else if(Constantes.ISUSAEJBREMOTE||Constantes.ISUSAEJBHOME) { this.procesopreciosporcentajes.remove(this.procesopreciosporcentaje); } ((ProcesoPreciosPorcentajeModel) this.jTableDatosProcesoPreciosPorcentaje.getModel()).fireTableRowsDeleted(rowIndex,rowIndex); this.actualizarFilaTotales(); this.inicializarActualizarBindingTablaProcesoPreciosPorcentaje(false); } } } catch(Exception e) { FuncionesSwing.manageException2(this, e,logger,ProcesoPreciosPorcentajeConstantesFunciones.CLASSNAME); } finally { this.estaModoSeleccionar=false; this.estaModoEliminarGuardarCambios=false; } } public void seleccionarProcesoPreciosPorcentaje(ActionEvent evt,javax.swing.event.ListSelectionEvent evt2,int rowIndex) throws Exception { try { //SI PUEDE SER NUEVO Y SELECCIONAR (PARA DUPLICAR Y NUEVO TABLA) //if(!this.isEsNuevoProcesoPreciosPorcentaje) { if(this.jInternalFrameDetalleFormProcesoPreciosPorcentaje==null) { //if(!this.conCargarFormDetalle) { this.inicializarFormDetalle(); } int intSelectedRow = 0; if(rowIndex>=0) { intSelectedRow=rowIndex; this.jTableDatosProcesoPreciosPorcentaje.getSelectionModel().setSelectionInterval(intSelectedRow, intSelectedRow); } else { intSelectedRow=this.jTableDatosProcesoPreciosPorcentaje.getSelectedRow(); } //CUANDO SE RECARGA TABLA TAMBIEN SE SELECCIONA PERO CON -1 POR LO QUE SE NECESITA VALIDAR ANTES if(intSelectedRow<0) { return; } //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentaje =(ProcesoPreciosPorcentaje) this.procesopreciosporcentajeLogic.getProcesoPreciosPorcentajes().toArray()[this.jTableDatosProcesoPreciosPorcentaje.convertRowIndexToModel(intSelectedRow)]; } else if(Constantes.ISUSAEJBREMOTE || Constantes.ISUSAEJBHOME ) { this.procesopreciosporcentaje =(ProcesoPreciosPorcentaje) this.procesopreciosporcentajes.toArray()[this.jTableDatosProcesoPreciosPorcentaje.convertRowIndexToModel(intSelectedRow)]; } if(ProcesoPreciosPorcentajeJInternalFrame.ISBINDING_MANUAL_TABLA) { this.setVariablesObjetoActualToFormularioProcesoPreciosPorcentaje(this.procesopreciosporcentaje); } //ARCHITECTURE try { } catch(Exception e) { throw e; } this.actualizarEstadoCeldasBotonesProcesoPreciosPorcentaje("s", this.isGuardarCambiosEnLote, this.isEsMantenimientoRelacionado); //NO FUNCIONA BINDING PERO SE MANTIENE this.inicializarActualizarBindingBotonesProcesoPreciosPorcentaje(false) ; //SI ES MANUAL //this.inicializarActualizarBindingBotonesManualProcesoPreciosPorcentaje() ; //} } catch(Exception e) { FuncionesSwing.manageException(this, e,logger,ProcesoPreciosPorcentajeConstantesFunciones.CLASSNAME); } } public void setVariablesObjetoActualToFormularioTodoProcesoPreciosPorcentaje(ProcesoPreciosPorcentaje procesopreciosporcentaje) throws Exception { this.setVariablesObjetoActualToFormularioTodoProcesoPreciosPorcentaje(procesopreciosporcentaje,false,"NINGUNO"); } public void setVariablesObjetoActualToFormularioTodoProcesoPreciosPorcentaje(ProcesoPreciosPorcentaje procesopreciosporcentaje,Boolean conCargarListasDesdeObjetoActual,String sTipoEvento) throws Exception { this.setVariablesObjetoActualToFormularioProcesoPreciosPorcentaje(procesopreciosporcentaje); if(conCargarListasDesdeObjetoActual) { this.setVariablesObjetoActualToListasForeignKeyProcesoPreciosPorcentaje(procesopreciosporcentaje,sTipoEvento); } this.setVariablesObjetoActualToFormularioForeignKeyProcesoPreciosPorcentaje(procesopreciosporcentaje); } public void setVariablesObjetoActualToFormularioProcesoPreciosPorcentaje(ProcesoPreciosPorcentaje procesopreciosporcentaje) throws Exception { try { Image imageActual=null; ImageIcon imageIcon = null; if(this.jInternalFrameDetalleFormProcesoPreciosPorcentaje==null) { //if(!this.conCargarFormDetalle) { this.inicializarFormDetalle(); } this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jLabelidProcesoPreciosPorcentaje.setText(procesopreciosporcentaje.getId().toString()); this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jTextAreacodigoProcesoPreciosPorcentaje.setText(procesopreciosporcentaje.getcodigo()); this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jTextAreanombreProcesoPreciosPorcentaje.setText(procesopreciosporcentaje.getnombre()); this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jTextFieldcodigo_productoProcesoPreciosPorcentaje.setText(procesopreciosporcentaje.getcodigo_producto()); this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jTextAreanombre_productoProcesoPreciosPorcentaje.setText(procesopreciosporcentaje.getnombre_producto()); this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jTextFieldprecioProcesoPreciosPorcentaje.setText(procesopreciosporcentaje.getprecio().toString()); this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jTextFieldporcentajeProcesoPreciosPorcentaje.setText(procesopreciosporcentaje.getporcentaje().toString()); } catch(Exception e) { throw e; //FuncionesSwing.manageException(this, e,logger,ProcesoPreciosPorcentajeConstantesFunciones.CLASSNAME); } } public void actualizarInformacion(String sTipo,ProcesoPreciosPorcentaje procesopreciosporcentajeLocal) throws Exception { this.actualizarInformacion(sTipo,false,procesopreciosporcentajeLocal); } public void actualizarInformacion(String sTipo,Boolean conParametroObjeto,ProcesoPreciosPorcentaje procesopreciosporcentajeLocal) throws Exception { if(!conParametroObjeto) { if(!this.getEsControlTabla()) { procesopreciosporcentajeLocal=this.procesopreciosporcentaje; } else { procesopreciosporcentajeLocal=this.procesopreciosporcentajeAnterior; } } if(this.permiteMantenimiento(procesopreciosporcentajeLocal)) { if(sTipo.equals("EVENTO_CONTROL")) { // || sTipo.equals("EVENTO_NUEVO") if(!this.esControlTabla) { this.setVariablesFormularioToObjetoActualTodoProcesoPreciosPorcentaje(procesopreciosporcentajeLocal,true); if(procesopreciosporcentajeSessionBean.getConGuardarRelaciones()) { this.actualizarRelaciones(procesopreciosporcentajeLocal); } } } else if(sTipo.equals("INFO_PADRE")) { if(this.procesopreciosporcentajeSessionBean.getEsGuardarRelacionado()) { this.actualizarRelacionFkPadreActual(procesopreciosporcentajeLocal); } } } } public void setVariablesFormularioToObjetoActualTodoProcesoPreciosPorcentaje(ProcesoPreciosPorcentaje procesopreciosporcentaje,Boolean conColumnasBase) throws Exception { this.setVariablesFormularioToObjetoActualProcesoPreciosPorcentaje(procesopreciosporcentaje,conColumnasBase); this.setVariablesFormularioToObjetoActualForeignKeysProcesoPreciosPorcentaje(procesopreciosporcentaje); } public void setVariablesFormularioToObjetoActualProcesoPreciosPorcentaje(ProcesoPreciosPorcentaje procesopreciosporcentaje,Boolean conColumnasBase) throws Exception { this.setVariablesFormularioToObjetoActualProcesoPreciosPorcentaje(procesopreciosporcentaje,conColumnasBase,true); } public void setVariablesFormularioToObjetoActualProcesoPreciosPorcentaje(ProcesoPreciosPorcentaje procesopreciosporcentaje,Boolean conColumnasBase,Boolean conInicializarInvalidValues) throws Exception { String sMensajeCampoActual=""; Boolean estaValidado=true; try { if(this.jInternalFrameDetalleFormProcesoPreciosPorcentaje==null) { //if(!this.conCargarFormDetalle) { this.inicializarFormDetalle(); } if(conInicializarInvalidValues) { this.inicializarInvalidValues(); } try { if(this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jLabelidProcesoPreciosPorcentaje.getText()==null || this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jLabelidProcesoPreciosPorcentaje.getText()=="" || this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jLabelidProcesoPreciosPorcentaje.getText()=="Id") { this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jLabelidProcesoPreciosPorcentaje.setText("0"); } if(conColumnasBase) {procesopreciosporcentaje.setId(Long.parseLong(this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jLabelidProcesoPreciosPorcentaje.getText()));} } catch(Exception e) { estaValidado=false; sMensajeCampoActual+="\r\n"+ProcesoPreciosPorcentajeConstantesFunciones.LABEL_ID+"-->"+ConstantesMensajes.SMENSAJEEXCEPCION_VALIDACIONVALOR;FuncionesSwing.mostrarCampoMensajeInvalido(false,this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jLabelIdProcesoPreciosPorcentaje,ConstantesMensajes.SMENSAJEEXCEPCION_VALIDACIONVALOR); } try { procesopreciosporcentaje.setcodigo(this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jTextAreacodigoProcesoPreciosPorcentaje.getText()); } catch(Exception e) { estaValidado=false; sMensajeCampoActual+="\r\n"+ProcesoPreciosPorcentajeConstantesFunciones.LABEL_CODIGO+"-->"+ConstantesMensajes.SMENSAJEEXCEPCION_VALIDACIONVALOR;FuncionesSwing.mostrarCampoMensajeInvalido(false,this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jLabelcodigoProcesoPreciosPorcentaje,ConstantesMensajes.SMENSAJEEXCEPCION_VALIDACIONVALOR); } try { procesopreciosporcentaje.setnombre(this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jTextAreanombreProcesoPreciosPorcentaje.getText()); } catch(Exception e) { estaValidado=false; sMensajeCampoActual+="\r\n"+ProcesoPreciosPorcentajeConstantesFunciones.LABEL_NOMBRE+"-->"+ConstantesMensajes.SMENSAJEEXCEPCION_VALIDACIONVALOR;FuncionesSwing.mostrarCampoMensajeInvalido(false,this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jLabelnombreProcesoPreciosPorcentaje,ConstantesMensajes.SMENSAJEEXCEPCION_VALIDACIONVALOR); } try { procesopreciosporcentaje.setcodigo_producto(this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jTextFieldcodigo_productoProcesoPreciosPorcentaje.getText()); } catch(Exception e) { estaValidado=false; sMensajeCampoActual+="\r\n"+ProcesoPreciosPorcentajeConstantesFunciones.LABEL_CODIGOPRODUCTO+"-->"+ConstantesMensajes.SMENSAJEEXCEPCION_VALIDACIONVALOR;FuncionesSwing.mostrarCampoMensajeInvalido(false,this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jLabelcodigo_productoProcesoPreciosPorcentaje,ConstantesMensajes.SMENSAJEEXCEPCION_VALIDACIONVALOR); } try { procesopreciosporcentaje.setnombre_producto(this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jTextAreanombre_productoProcesoPreciosPorcentaje.getText()); } catch(Exception e) { estaValidado=false; sMensajeCampoActual+="\r\n"+ProcesoPreciosPorcentajeConstantesFunciones.LABEL_NOMBREPRODUCTO+"-->"+ConstantesMensajes.SMENSAJEEXCEPCION_VALIDACIONVALOR;FuncionesSwing.mostrarCampoMensajeInvalido(false,this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jLabelnombre_productoProcesoPreciosPorcentaje,ConstantesMensajes.SMENSAJEEXCEPCION_VALIDACIONVALOR); } try { procesopreciosporcentaje.setprecio(Double.parseDouble(this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jTextFieldprecioProcesoPreciosPorcentaje.getText())); } catch(Exception e) { estaValidado=false; sMensajeCampoActual+="\r\n"+ProcesoPreciosPorcentajeConstantesFunciones.LABEL_PRECIO+"-->"+ConstantesMensajes.SMENSAJEEXCEPCION_VALIDACIONVALOR;FuncionesSwing.mostrarCampoMensajeInvalido(false,this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jLabelprecioProcesoPreciosPorcentaje,ConstantesMensajes.SMENSAJEEXCEPCION_VALIDACIONVALOR); } try { procesopreciosporcentaje.setporcentaje(Double.parseDouble(this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jTextFieldporcentajeProcesoPreciosPorcentaje.getText())); } catch(Exception e) { estaValidado=false; sMensajeCampoActual+="\r\n"+ProcesoPreciosPorcentajeConstantesFunciones.LABEL_PORCENTAJE+"-->"+ConstantesMensajes.SMENSAJEEXCEPCION_VALIDACIONVALOR;FuncionesSwing.mostrarCampoMensajeInvalido(false,this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jLabelporcentajeProcesoPreciosPorcentaje,ConstantesMensajes.SMENSAJEEXCEPCION_VALIDACIONVALOR); } if(!estaValidado) { throw new Exception(sMensajeCampoActual); } } catch(NumberFormatException e) { throw new Exception(sMensajeCampoActual); //FuncionesSwing.manageException(this, e,logger,MovimientoInventarioConstantesFunciones.CLASSNAME); } catch(Exception e) { throw e; //FuncionesSwing.manageException(this, e,logger,ProcesoPreciosPorcentajeConstantesFunciones.CLASSNAME); } } public void setVariablesForeignKeyObjetoBeanDefectoActualToObjetoActualProcesoPreciosPorcentaje(ProcesoPreciosPorcentaje procesopreciosporcentajeBean,ProcesoPreciosPorcentaje procesopreciosporcentaje,Boolean conDefault,Boolean conColumnasBase) throws Exception { try { } catch(Exception e) { throw e; //FuncionesSwing.manageException(this, e,logger,ProcesoPreciosPorcentajeConstantesFunciones.CLASSNAME); } } public void setCopiarVariablesObjetosProcesoPreciosPorcentaje(ProcesoPreciosPorcentaje procesopreciosporcentajeOrigen,ProcesoPreciosPorcentaje procesopreciosporcentaje,Boolean conDefault,Boolean conColumnasBase) throws Exception { try { if(conColumnasBase) {if(conDefault || (!conDefault && procesopreciosporcentajeOrigen.getId()!=null && !procesopreciosporcentajeOrigen.getId().equals(0L))) {procesopreciosporcentaje.setId(procesopreciosporcentajeOrigen.getId());}} if(conDefault || (!conDefault && procesopreciosporcentajeOrigen.getcodigo()!=null && !procesopreciosporcentajeOrigen.getcodigo().equals(""))) {procesopreciosporcentaje.setcodigo(procesopreciosporcentajeOrigen.getcodigo());} if(conDefault || (!conDefault && procesopreciosporcentajeOrigen.getnombre()!=null && !procesopreciosporcentajeOrigen.getnombre().equals(""))) {procesopreciosporcentaje.setnombre(procesopreciosporcentajeOrigen.getnombre());} if(conDefault || (!conDefault && procesopreciosporcentajeOrigen.getcodigo_producto()!=null && !procesopreciosporcentajeOrigen.getcodigo_producto().equals(""))) {procesopreciosporcentaje.setcodigo_producto(procesopreciosporcentajeOrigen.getcodigo_producto());} if(conDefault || (!conDefault && procesopreciosporcentajeOrigen.getnombre_producto()!=null && !procesopreciosporcentajeOrigen.getnombre_producto().equals(""))) {procesopreciosporcentaje.setnombre_producto(procesopreciosporcentajeOrigen.getnombre_producto());} if(conDefault || (!conDefault && procesopreciosporcentajeOrigen.getprecio()!=null && !procesopreciosporcentajeOrigen.getprecio().equals(0.0))) {procesopreciosporcentaje.setprecio(procesopreciosporcentajeOrigen.getprecio());} if(conDefault || (!conDefault && procesopreciosporcentajeOrigen.getporcentaje()!=null && !procesopreciosporcentajeOrigen.getporcentaje().equals(0.0))) {procesopreciosporcentaje.setporcentaje(procesopreciosporcentajeOrigen.getporcentaje());} } catch(Exception e) { throw e; //FuncionesSwing.manageException(this, e,logger,ProcesoPreciosPorcentajeConstantesFunciones.CLASSNAME); } } /* public void setVariablesObjetoBeanActualToFormularioProcesoPreciosPorcentaje(ProcesoPreciosPorcentaje procesopreciosporcentaje) throws Exception { try { this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jLabelidProcesoPreciosPorcentaje.setText(procesopreciosporcentaje.getId().toString()); this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jTextAreacodigoProcesoPreciosPorcentaje.setText(procesopreciosporcentaje.getcodigo()); this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jTextAreanombreProcesoPreciosPorcentaje.setText(procesopreciosporcentaje.getnombre()); this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jTextFieldcodigo_productoProcesoPreciosPorcentaje.setText(procesopreciosporcentaje.getcodigo_producto()); this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jTextAreanombre_productoProcesoPreciosPorcentaje.setText(procesopreciosporcentaje.getnombre_producto()); this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jTextFieldprecioProcesoPreciosPorcentaje.setText(procesopreciosporcentaje.getprecio().toString()); this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jTextFieldporcentajeProcesoPreciosPorcentaje.setText(procesopreciosporcentaje.getporcentaje().toString()); } catch(Exception e) { FuncionesSwing.manageException(this, e,logger,ProcesoPreciosPorcentajeConstantesFunciones.CLASSNAME); } } */ /* public void setVariablesObjetoBeanActualToFormularioProcesoPreciosPorcentaje(ProcesoPreciosPorcentajeBean procesopreciosporcentajeBean) throws Exception { try { this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jLabelidProcesoPreciosPorcentaje.setText(procesopreciosporcentajeBean.getId().toString()); this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jTextAreacodigoProcesoPreciosPorcentaje.setText(procesopreciosporcentajeBean.getcodigo()); this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jTextAreanombreProcesoPreciosPorcentaje.setText(procesopreciosporcentajeBean.getnombre()); this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jTextFieldcodigo_productoProcesoPreciosPorcentaje.setText(procesopreciosporcentajeBean.getcodigo_producto()); this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jTextAreanombre_productoProcesoPreciosPorcentaje.setText(procesopreciosporcentajeBean.getnombre_producto()); this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jTextFieldprecioProcesoPreciosPorcentaje.setText(procesopreciosporcentajeBean.getprecio().toString()); this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jTextFieldporcentajeProcesoPreciosPorcentaje.setText(procesopreciosporcentajeBean.getporcentaje().toString()); } catch(Exception e) { FuncionesSwing.manageException(this, e,logger,ProcesoPreciosPorcentajeConstantesFunciones.CLASSNAME); } } */ /* public void setVariablesObjetoReturnGeneralToBeanProcesoPreciosPorcentaje(ProcesoPreciosPorcentajeParameterReturnGeneral procesopreciosporcentajeReturnGeneral,ProcesoPreciosPorcentajeBean procesopreciosporcentajeBean,Boolean conDefault) throws Exception { try { ProcesoPreciosPorcentaje procesopreciosporcentajeLocal=new ProcesoPreciosPorcentaje(); procesopreciosporcentajeLocal=procesopreciosporcentajeReturnGeneral.getProcesoPreciosPorcentaje(); if(conColumnasBase) {if(conDefault || (!conDefault && procesopreciosporcentajeLocal.getId()!=null && !procesopreciosporcentajeLocal.getId().equals(0L))) {procesopreciosporcentajeBean.setId(procesopreciosporcentajeLocal.getId());}} if(conDefault || (!conDefault && procesopreciosporcentajeLocal.getcodigo()!=null && !procesopreciosporcentajeLocal.getcodigo().equals(""))) {procesopreciosporcentajeBean.setcodigo(procesopreciosporcentajeLocal.getcodigo());} if(conDefault || (!conDefault && procesopreciosporcentajeLocal.getnombre()!=null && !procesopreciosporcentajeLocal.getnombre().equals(""))) {procesopreciosporcentajeBean.setnombre(procesopreciosporcentajeLocal.getnombre());} if(conDefault || (!conDefault && procesopreciosporcentajeLocal.getcodigo_producto()!=null && !procesopreciosporcentajeLocal.getcodigo_producto().equals(""))) {procesopreciosporcentajeBean.setcodigo_producto(procesopreciosporcentajeLocal.getcodigo_producto());} if(conDefault || (!conDefault && procesopreciosporcentajeLocal.getnombre_producto()!=null && !procesopreciosporcentajeLocal.getnombre_producto().equals(""))) {procesopreciosporcentajeBean.setnombre_producto(procesopreciosporcentajeLocal.getnombre_producto());} if(conDefault || (!conDefault && procesopreciosporcentajeLocal.getprecio()!=null && !procesopreciosporcentajeLocal.getprecio().equals(0.0))) {procesopreciosporcentajeBean.setprecio(procesopreciosporcentajeLocal.getprecio());} if(conDefault || (!conDefault && procesopreciosporcentajeLocal.getporcentaje()!=null && !procesopreciosporcentajeLocal.getporcentaje().equals(0.0))) {procesopreciosporcentajeBean.setporcentaje(procesopreciosporcentajeLocal.getporcentaje());} } catch(Exception e) { FuncionesSwing.manageException(this, e,logger,ProcesoPreciosPorcentajeConstantesFunciones.CLASSNAME); } } */ @SuppressWarnings("rawtypes") public static void setActualComboBoxProcesoPreciosPorcentajeGenerico(Long idProcesoPreciosPorcentajeSeleccionado,JComboBox jComboBoxProcesoPreciosPorcentaje,List<ProcesoPreciosPorcentaje> procesopreciosporcentajesLocal)throws Exception { try { ProcesoPreciosPorcentaje procesopreciosporcentajeTemp=null; for(ProcesoPreciosPorcentaje procesopreciosporcentajeAux:procesopreciosporcentajesLocal) { if(procesopreciosporcentajeAux.getId()!=null && procesopreciosporcentajeAux.getId().equals(idProcesoPreciosPorcentajeSeleccionado)) { procesopreciosporcentajeTemp=procesopreciosporcentajeAux; break; } } jComboBoxProcesoPreciosPorcentaje.setSelectedItem(procesopreciosporcentajeTemp); } catch(Exception e) { throw e; } } @SuppressWarnings("rawtypes") public static void setHotKeysComboBoxProcesoPreciosPorcentajeGenerico(JComboBox jComboBoxProcesoPreciosPorcentaje,JInternalFrameBase jInternalFrameBase,String sNombreHotKeyAbstractAction,String sTipoBusqueda)throws Exception { try { //GLOBAL(id_empresa,id_sucursal,id_ejercicio) //BASICO(normal) //CON_BUSQUEDA(Permite buscar Fk) String sKeyStrokeName=""; KeyStroke keyStrokeControl=null; if(!sTipoBusqueda.equals("GLOBAL")) { //BUSCAR sKeyStrokeName = FuncionesSwing.getKeyNameControl("CONTROL_BUSCAR"); keyStrokeControl=FuncionesSwing.getKeyStrokeControl("CONTROL_BUSCAR"); jComboBoxProcesoPreciosPorcentaje.getInputMap().put(keyStrokeControl, sKeyStrokeName); jComboBoxProcesoPreciosPorcentaje.getActionMap().put(sKeyStrokeName, new ButtonAbstractAction(jInternalFrameBase,sNombreHotKeyAbstractAction+"Busqueda")); //BUSCAR //ACTUALIZAR sKeyStrokeName = FuncionesSwing.getKeyNameControl("CONTROL_ACTUALIZAR"); keyStrokeControl=FuncionesSwing.getKeyStrokeControl("CONTROL_ACTUALIZAR"); jComboBoxProcesoPreciosPorcentaje.getInputMap().put(keyStrokeControl, sKeyStrokeName); jComboBoxProcesoPreciosPorcentaje.getActionMap().put(sKeyStrokeName, new ButtonAbstractAction(jInternalFrameBase,sNombreHotKeyAbstractAction+"Update")); //ACTUALIZAR if(sTipoBusqueda.contains("CON_EVENT_CHANGE")) { if(Constantes2.CON_COMBOBOX_ITEMLISTENER) { jComboBoxProcesoPreciosPorcentaje.addFocusListener(new ComboBoxFocusListener(jInternalFrameBase,sNombreHotKeyAbstractAction)); jComboBoxProcesoPreciosPorcentaje.addActionListener(new ComboBoxActionListener(jInternalFrameBase,sNombreHotKeyAbstractAction)); } /* if(Constantes2.CON_COMBOBOX_ITEMLISTENER) { jComboBoxProcesoPreciosPorcentaje.addItemListener(new ComboBoxItemListener(jInternalFrameBase,sNombreHotKeyAbstractAction)); } else { jComboBoxProcesoPreciosPorcentaje.addActionListener(new ComboBoxActionListener(jInternalFrameBase,sNombreHotKeyAbstractAction)); } */ } //CON_BUSQUEDA if(sTipoBusqueda.contains("CON_BUSQUEDA")) { sKeyStrokeName = FuncionesSwing.getKeyNameControl("CONTROL_BUSQUEDA"); keyStrokeControl=FuncionesSwing.getKeyStrokeControl("CONTROL_BUSQUEDA"); jComboBoxProcesoPreciosPorcentaje.getInputMap().put(keyStrokeControl, sKeyStrokeName); jComboBoxProcesoPreciosPorcentaje.getActionMap().put(sKeyStrokeName, new ButtonAbstractAction(jInternalFrameBase,sNombreHotKeyAbstractAction)); } //CON_BUSQUEDA } } catch(Exception e) { throw e; } } //PARA INICIALIZAR CONTROLES DE TABLA @SuppressWarnings("rawtypes") public void setHotKeysComboBoxGenerico(JComboBox jComboBox,JInternalFrameBase jInternalFrameBase,String sNombreHotKeyAbstractAction,String sTipoBusqueda) { if(sTipoBusqueda.contains("CON_EVENT_CHANGE")) { if(Constantes2.CON_COMBOBOX_ITEMLISTENER) { jComboBox.addItemListener(new ComboBoxItemListener(jInternalFrameBase,sNombreHotKeyAbstractAction)); jComboBox.addFocusListener(new ComboBoxFocusListener(jInternalFrameBase,sNombreHotKeyAbstractAction)); } else { jComboBox.addActionListener(new ComboBoxActionListener(jInternalFrameBase,sNombreHotKeyAbstractAction)); jComboBox.addFocusListener(new ComboBoxFocusListener(jInternalFrameBase,sNombreHotKeyAbstractAction)); } } } //PARA INICIALIZAR CONTROLES DE TABLA public void setHotKeysJTextFieldGenerico(JTextField jTextField,JInternalFrameBase jInternalFrameBase,String sNombreHotKeyAbstractAction,String sTipoBusqueda) { jTextField.addFocusListener(new TextFieldFocusListener(jInternalFrameBase,sNombreHotKeyAbstractAction)); jTextField.addActionListener(new TextFieldActionListener(jInternalFrameBase,sNombreHotKeyAbstractAction)); } //PARA INICIALIZAR CONTROLES DE TABLA public void setHotKeysJTextAreaGenerico(JTextArea jTextArea,JInternalFrameBase jInternalFrameBase,String sNombreHotKeyAbstractAction,String sTipoBusqueda) { jTextArea.addFocusListener(new TextAreaFocusListener(jInternalFrameBase,sNombreHotKeyAbstractAction)); //NO EXISTE //jTextArea.addActionListener(new TextAreaActionListener(jInternalFrameBase,sNombreHotKeyAbstractAction)); } //PARA INICIALIZAR CONTROLES DE TABLA public void setHotKeysJLabelGenerico(JLabel jLabel,JInternalFrameBase jInternalFrameBase,String sNombreHotKeyAbstractAction,String sTipoBusqueda) { jLabel.addFocusListener(new LabelFocusListener(jInternalFrameBase,sNombreHotKeyAbstractAction)); //NO EXISTE //jLabel.addActionListener(new LabelActionListener(jInternalFrameBase,sNombreHotKeyAbstractAction)); } //PARA INICIALIZAR CONTROLES DE TABLA public void setHotKeysJCheckBoxGenerico(JCheckBox jCheckBox,JInternalFrameBase jInternalFrameBase,String sNombreHotKeyAbstractAction,String sTipoBusqueda) { jCheckBox.addFocusListener(new CheckBoxFocusListener(jInternalFrameBase,sNombreHotKeyAbstractAction)); //SI SE DEFINE AL CAMBIAR VALOR, ESTE NUEVO VALOR NO SE ENVIA AL EVENTO //jCheckBox.addItemListener(new CheckBoxItemListener(jInternalFrameBase,sNombreHotKeyAbstractAction)); } //PARA INICIALIZAR CONTROLES DE TABLA public void setHotKeysJDateChooserGenerico(JDateChooser jDateChooser,JInternalFrameBase jInternalFrameBase,String sNombreHotKeyAbstractAction,String sTipoBusqueda) { FuncionesSwing.addDateListener(jDateChooser, jInternalFrameBase, sNombreHotKeyAbstractAction); } //PARA INICIALIZAR CONTROLES DE TABLA public void setHotKeysJButtonGenerico(JButton jButton,JInternalFrameBase jInternalFrameBase,String sNombreHotKeyAbstractAction,String sTipoBusqueda) { jButton.addActionListener(new ButtonActionListener(jInternalFrameBase,sNombreHotKeyAbstractAction)); } public void jButtonRelacionActionPerformed(String sTipo,ActionEvent evt,int rowIndex,Boolean conInicializar,Boolean esRelacionado) { //ABRIR RELACIONES try { } catch (Exception e) { FuncionesSwing.manageException2(this, e,logger,ProcesoPreciosPorcentajeConstantesFunciones.CLASSNAME); } } public String getDescripcionFk(String sTipo,JTable table,Object value,int intSelectedRow) throws Exception { //DESCRIPCIONES FK String sDescripcion=""; if(Constantes.ISUSAEJBLOGICLAYER) { procesopreciosporcentaje=(ProcesoPreciosPorcentaje) procesopreciosporcentajeLogic.getProcesoPreciosPorcentajes().toArray()[table.convertRowIndexToModel(intSelectedRow)]; } else if(Constantes.ISUSAEJBREMOTE) { procesopreciosporcentaje =(ProcesoPreciosPorcentaje) procesopreciosporcentajes.toArray()[table.convertRowIndexToModel(intSelectedRow)]; } if(sTipo.equals("Bodega")) { //sDescripcion=this.getActualBodegaForeignKeyDescripcion((Long)value); if(!procesopreciosporcentaje.getIsNew() && !procesopreciosporcentaje.getIsChanged() && !procesopreciosporcentaje.getIsDeleted()) { sDescripcion=procesopreciosporcentaje.getbodega_descripcion(); } else { //sDescripcion=this.getActualBodegaForeignKeyDescripcion((Long)value); sDescripcion=procesopreciosporcentaje.getbodega_descripcion(); } } if(sTipo.equals("Producto")) { //sDescripcion=this.getActualProductoForeignKeyDescripcion((Long)value); if(!procesopreciosporcentaje.getIsNew() && !procesopreciosporcentaje.getIsChanged() && !procesopreciosporcentaje.getIsDeleted()) { sDescripcion=procesopreciosporcentaje.getproducto_descripcion(); } else { //sDescripcion=this.getActualProductoForeignKeyDescripcion((Long)value); sDescripcion=procesopreciosporcentaje.getproducto_descripcion(); } } if(sTipo.equals("Empresa")) { //sDescripcion=this.getActualEmpresaForeignKeyDescripcion((Long)value); if(!procesopreciosporcentaje.getIsNew() && !procesopreciosporcentaje.getIsChanged() && !procesopreciosporcentaje.getIsDeleted()) { sDescripcion=procesopreciosporcentaje.getempresa_descripcion(); } else { //sDescripcion=this.getActualEmpresaForeignKeyDescripcion((Long)value); sDescripcion=procesopreciosporcentaje.getempresa_descripcion(); } } if(sTipo.equals("Sucursal")) { //sDescripcion=this.getActualSucursalForeignKeyDescripcion((Long)value); if(!procesopreciosporcentaje.getIsNew() && !procesopreciosporcentaje.getIsChanged() && !procesopreciosporcentaje.getIsDeleted()) { sDescripcion=procesopreciosporcentaje.getsucursal_descripcion(); } else { //sDescripcion=this.getActualSucursalForeignKeyDescripcion((Long)value); sDescripcion=procesopreciosporcentaje.getsucursal_descripcion(); } } if(sTipo.equals("Linea")) { //sDescripcion=this.getActualLineaForeignKeyDescripcion((Long)value); if(!procesopreciosporcentaje.getIsNew() && !procesopreciosporcentaje.getIsChanged() && !procesopreciosporcentaje.getIsDeleted()) { sDescripcion=procesopreciosporcentaje.getlinea_descripcion(); } else { //sDescripcion=this.getActualLineaForeignKeyDescripcion((Long)value); sDescripcion=procesopreciosporcentaje.getlinea_descripcion(); } } if(sTipo.equals("LineaGrupo")) { //sDescripcion=this.getActualLineaGrupoForeignKeyDescripcion((Long)value); if(!procesopreciosporcentaje.getIsNew() && !procesopreciosporcentaje.getIsChanged() && !procesopreciosporcentaje.getIsDeleted()) { sDescripcion=procesopreciosporcentaje.getlineagrupo_descripcion(); } else { //sDescripcion=this.getActualLineaGrupoForeignKeyDescripcion((Long)value); sDescripcion=procesopreciosporcentaje.getlineagrupo_descripcion(); } } if(sTipo.equals("LineaCategoria")) { //sDescripcion=this.getActualLineaCategoriaForeignKeyDescripcion((Long)value); if(!procesopreciosporcentaje.getIsNew() && !procesopreciosporcentaje.getIsChanged() && !procesopreciosporcentaje.getIsDeleted()) { sDescripcion=procesopreciosporcentaje.getlineacategoria_descripcion(); } else { //sDescripcion=this.getActualLineaCategoriaForeignKeyDescripcion((Long)value); sDescripcion=procesopreciosporcentaje.getlineacategoria_descripcion(); } } if(sTipo.equals("LineaMarca")) { //sDescripcion=this.getActualLineaMarcaForeignKeyDescripcion((Long)value); if(!procesopreciosporcentaje.getIsNew() && !procesopreciosporcentaje.getIsChanged() && !procesopreciosporcentaje.getIsDeleted()) { sDescripcion=procesopreciosporcentaje.getlineamarca_descripcion(); } else { //sDescripcion=this.getActualLineaMarcaForeignKeyDescripcion((Long)value); sDescripcion=procesopreciosporcentaje.getlineamarca_descripcion(); } } return sDescripcion; } public Color getColorFk(String sTipo,JTable table,Object value,int intSelectedRow) throws Exception { //DESCRIPCIONES FK Color color=Color.WHITE; ProcesoPreciosPorcentaje procesopreciosporcentajeRow=new ProcesoPreciosPorcentaje(); if(Constantes.ISUSAEJBLOGICLAYER) { procesopreciosporcentajeRow=(ProcesoPreciosPorcentaje) procesopreciosporcentajeLogic.getProcesoPreciosPorcentajes().toArray()[table.convertRowIndexToModel(intSelectedRow)]; } else if(Constantes.ISUSAEJBREMOTE) { procesopreciosporcentajeRow=(ProcesoPreciosPorcentaje) procesopreciosporcentajes.toArray()[table.convertRowIndexToModel(intSelectedRow)]; } return color; } public void refrescarBindingTabla(Boolean blnSoloTabla) { } public void inicializarActualizarBindingBotonesManualProcesoPreciosPorcentaje(Boolean esSetControles) { if(esSetControles) { this.jButtonNuevoProcesoPreciosPorcentaje.setVisible((this.isVisibilidadCeldaNuevoProcesoPreciosPorcentaje && this.isPermisoNuevoProcesoPreciosPorcentaje)); this.jButtonDuplicarProcesoPreciosPorcentaje.setVisible((this.isVisibilidadCeldaDuplicarProcesoPreciosPorcentaje && this.isPermisoDuplicarProcesoPreciosPorcentaje)); this.jButtonCopiarProcesoPreciosPorcentaje.setVisible((this.isVisibilidadCeldaCopiarProcesoPreciosPorcentaje && this.isPermisoCopiarProcesoPreciosPorcentaje)); this.jButtonVerFormProcesoPreciosPorcentaje.setVisible((this.isVisibilidadCeldaVerFormProcesoPreciosPorcentaje && this.isPermisoVerFormProcesoPreciosPorcentaje)); this.jButtonAbrirOrderByProcesoPreciosPorcentaje.setVisible((this.isVisibilidadCeldaOrdenProcesoPreciosPorcentaje && this.isPermisoOrdenProcesoPreciosPorcentaje)); this.jButtonNuevoRelacionesProcesoPreciosPorcentaje.setVisible((this.isVisibilidadCeldaNuevoRelacionesProcesoPreciosPorcentaje && this.isPermisoNuevoProcesoPreciosPorcentaje)); this.jButtonNuevoGuardarCambiosProcesoPreciosPorcentaje.setVisible((this.isVisibilidadCeldaNuevoProcesoPreciosPorcentaje && this.isPermisoNuevoProcesoPreciosPorcentaje && this.isPermisoGuardarCambiosProcesoPreciosPorcentaje)); if(this.jInternalFrameDetalleFormProcesoPreciosPorcentaje!=null) { this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jButtonModificarProcesoPreciosPorcentaje.setVisible((this.isVisibilidadCeldaModificarProcesoPreciosPorcentaje && this.isPermisoActualizarProcesoPreciosPorcentaje)); this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jButtonActualizarProcesoPreciosPorcentaje.setVisible((this.isVisibilidadCeldaActualizarProcesoPreciosPorcentaje && this.isPermisoActualizarProcesoPreciosPorcentaje)); this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jButtonEliminarProcesoPreciosPorcentaje.setVisible((this.isVisibilidadCeldaEliminarProcesoPreciosPorcentaje && this.isPermisoEliminarProcesoPreciosPorcentaje)); this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jButtonCancelarProcesoPreciosPorcentaje.setVisible(this.isVisibilidadCeldaCancelarProcesoPreciosPorcentaje); this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jButtonGuardarCambiosProcesoPreciosPorcentaje.setVisible((this.isVisibilidadCeldaGuardarProcesoPreciosPorcentaje && this.isPermisoGuardarCambiosProcesoPreciosPorcentaje)); } this.jButtonGuardarCambiosTablaProcesoPreciosPorcentaje.setVisible((this.isVisibilidadCeldaGuardarCambiosProcesoPreciosPorcentaje && this.isPermisoGuardarCambiosProcesoPreciosPorcentaje)); //TOOLBAR this.jButtonNuevoToolBarProcesoPreciosPorcentaje.setVisible((this.isVisibilidadCeldaNuevoProcesoPreciosPorcentaje && this.isPermisoNuevoProcesoPreciosPorcentaje)); this.jButtonDuplicarToolBarProcesoPreciosPorcentaje.setVisible((this.isVisibilidadCeldaDuplicarProcesoPreciosPorcentaje && this.isPermisoDuplicarProcesoPreciosPorcentaje)); this.jButtonCopiarToolBarProcesoPreciosPorcentaje.setVisible((this.isVisibilidadCeldaCopiarProcesoPreciosPorcentaje && this.isPermisoCopiarProcesoPreciosPorcentaje)); this.jButtonVerFormToolBarProcesoPreciosPorcentaje.setVisible((this.isVisibilidadCeldaVerFormProcesoPreciosPorcentaje && this.isPermisoVerFormProcesoPreciosPorcentaje)); this.jButtonAbrirOrderByToolBarProcesoPreciosPorcentaje.setVisible((this.isVisibilidadCeldaOrdenProcesoPreciosPorcentaje && this.isPermisoOrdenProcesoPreciosPorcentaje)); this.jButtonNuevoRelacionesToolBarProcesoPreciosPorcentaje.setVisible((this.isVisibilidadCeldaNuevoRelacionesProcesoPreciosPorcentaje && this.isPermisoNuevoProcesoPreciosPorcentaje)); this.jButtonNuevoGuardarCambiosToolBarProcesoPreciosPorcentaje.setVisible((this.isVisibilidadCeldaNuevoProcesoPreciosPorcentaje && this.isPermisoNuevoProcesoPreciosPorcentaje && this.isPermisoGuardarCambiosProcesoPreciosPorcentaje)); if(this.jInternalFrameDetalleFormProcesoPreciosPorcentaje!=null) { this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jButtonModificarToolBarProcesoPreciosPorcentaje.setVisible((this.isVisibilidadCeldaModificarProcesoPreciosPorcentaje && this.isPermisoActualizarProcesoPreciosPorcentaje)); this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jButtonActualizarToolBarProcesoPreciosPorcentaje.setVisible((this.isVisibilidadCeldaActualizarProcesoPreciosPorcentaje && this.isPermisoActualizarProcesoPreciosPorcentaje)); this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jButtonEliminarToolBarProcesoPreciosPorcentaje.setVisible((this.isVisibilidadCeldaEliminarProcesoPreciosPorcentaje && this.isPermisoEliminarProcesoPreciosPorcentaje)); this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jButtonCancelarToolBarProcesoPreciosPorcentaje.setVisible(this.isVisibilidadCeldaCancelarProcesoPreciosPorcentaje); this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jButtonGuardarCambiosToolBarProcesoPreciosPorcentaje.setVisible((this.isVisibilidadCeldaGuardarProcesoPreciosPorcentaje && this.isPermisoGuardarCambiosProcesoPreciosPorcentaje)); } this.jButtonGuardarCambiosTablaToolBarProcesoPreciosPorcentaje.setVisible((this.isVisibilidadCeldaGuardarCambiosProcesoPreciosPorcentaje && this.isPermisoGuardarCambiosProcesoPreciosPorcentaje)); //TOOLBAR //MENUS this.jMenuItemNuevoProcesoPreciosPorcentaje.setVisible((this.isVisibilidadCeldaNuevoProcesoPreciosPorcentaje && this.isPermisoNuevoProcesoPreciosPorcentaje)); this.jMenuItemDuplicarProcesoPreciosPorcentaje.setVisible((this.isVisibilidadCeldaDuplicarProcesoPreciosPorcentaje && this.isPermisoDuplicarProcesoPreciosPorcentaje)); this.jMenuItemCopiarProcesoPreciosPorcentaje.setVisible((this.isVisibilidadCeldaCopiarProcesoPreciosPorcentaje && this.isPermisoCopiarProcesoPreciosPorcentaje)); this.jMenuItemVerFormProcesoPreciosPorcentaje.setVisible((this.isVisibilidadCeldaVerFormProcesoPreciosPorcentaje && this.isPermisoVerFormProcesoPreciosPorcentaje)); this.jMenuItemAbrirOrderByProcesoPreciosPorcentaje.setVisible((this.isVisibilidadCeldaOrdenProcesoPreciosPorcentaje && this.isPermisoOrdenProcesoPreciosPorcentaje)); //this.jMenuItemMostrarOcultarProcesoPreciosPorcentaje.setVisible((this.isVisibilidadCeldaOrdenProcesoPreciosPorcentaje && this.isPermisoOrdenProcesoPreciosPorcentaje)); this.jMenuItemDetalleAbrirOrderByProcesoPreciosPorcentaje.setVisible((this.isVisibilidadCeldaOrdenProcesoPreciosPorcentaje && this.isPermisoOrdenProcesoPreciosPorcentaje)); //this.jMenuItemDetalleMostrarOcultarProcesoPreciosPorcentaje.setVisible((this.isVisibilidadCeldaOrdenProcesoPreciosPorcentaje && this.isPermisoOrdenProcesoPreciosPorcentaje)); this.jMenuItemNuevoRelacionesProcesoPreciosPorcentaje.setVisible((this.isVisibilidadCeldaNuevoRelacionesProcesoPreciosPorcentaje && this.isPermisoNuevoProcesoPreciosPorcentaje)); this.jMenuItemNuevoGuardarCambiosProcesoPreciosPorcentaje.setVisible((this.isVisibilidadCeldaNuevoProcesoPreciosPorcentaje && this.isPermisoNuevoProcesoPreciosPorcentaje && this.isPermisoGuardarCambiosProcesoPreciosPorcentaje)); if(this.jInternalFrameDetalleFormProcesoPreciosPorcentaje!=null) { this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jMenuItemModificarProcesoPreciosPorcentaje.setVisible((this.isVisibilidadCeldaModificarProcesoPreciosPorcentaje && this.isPermisoActualizarProcesoPreciosPorcentaje)); this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jMenuItemActualizarProcesoPreciosPorcentaje.setVisible((this.isVisibilidadCeldaActualizarProcesoPreciosPorcentaje && this.isPermisoActualizarProcesoPreciosPorcentaje)); this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jMenuItemEliminarProcesoPreciosPorcentaje.setVisible((this.isVisibilidadCeldaEliminarProcesoPreciosPorcentaje && this.isPermisoEliminarProcesoPreciosPorcentaje)); this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jMenuItemCancelarProcesoPreciosPorcentaje.setVisible(this.isVisibilidadCeldaCancelarProcesoPreciosPorcentaje); } this.jMenuItemGuardarCambiosProcesoPreciosPorcentaje.setVisible((this.isVisibilidadCeldaGuardarProcesoPreciosPorcentaje && this.isPermisoGuardarCambiosProcesoPreciosPorcentaje)); this.jMenuItemGuardarCambiosTablaProcesoPreciosPorcentaje.setVisible((this.isVisibilidadCeldaGuardarCambiosProcesoPreciosPorcentaje && this.isPermisoGuardarCambiosProcesoPreciosPorcentaje)); //MENUS } else { this.isVisibilidadCeldaNuevoProcesoPreciosPorcentaje=this.jButtonNuevoProcesoPreciosPorcentaje.isVisible(); this.isVisibilidadCeldaDuplicarProcesoPreciosPorcentaje=this.jButtonDuplicarProcesoPreciosPorcentaje.isVisible(); this.isVisibilidadCeldaCopiarProcesoPreciosPorcentaje=this.jButtonCopiarProcesoPreciosPorcentaje.isVisible(); this.isVisibilidadCeldaVerFormProcesoPreciosPorcentaje=this.jButtonVerFormProcesoPreciosPorcentaje.isVisible(); this.isVisibilidadCeldaOrdenProcesoPreciosPorcentaje=this.jButtonAbrirOrderByProcesoPreciosPorcentaje.isVisible(); this.isVisibilidadCeldaNuevoRelacionesProcesoPreciosPorcentaje=this.jButtonNuevoRelacionesProcesoPreciosPorcentaje.isVisible(); this.isVisibilidadCeldaModificarProcesoPreciosPorcentaje=this.jButtonModificarProcesoPreciosPorcentaje.isVisible(); if(this.jInternalFrameDetalleFormProcesoPreciosPorcentaje!=null) { this.isVisibilidadCeldaActualizarProcesoPreciosPorcentaje=this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jButtonActualizarProcesoPreciosPorcentaje.isVisible(); this.isVisibilidadCeldaEliminarProcesoPreciosPorcentaje=this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jButtonEliminarProcesoPreciosPorcentaje.isVisible(); this.isVisibilidadCeldaCancelarProcesoPreciosPorcentaje=this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jButtonCancelarProcesoPreciosPorcentaje.isVisible(); this.isVisibilidadCeldaGuardarProcesoPreciosPorcentaje=this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jButtonGuardarCambiosProcesoPreciosPorcentaje.isVisible(); } this.isVisibilidadCeldaGuardarCambiosProcesoPreciosPorcentaje=this.jButtonGuardarCambiosTablaProcesoPreciosPorcentaje.isVisible(); //TOOLBAR this.isVisibilidadCeldaNuevoProcesoPreciosPorcentaje=this.jButtonNuevoToolBarProcesoPreciosPorcentaje.isVisible(); this.isVisibilidadCeldaNuevoRelacionesProcesoPreciosPorcentaje=this.jButtonNuevoRelacionesToolBarProcesoPreciosPorcentaje.isVisible(); if(this.jInternalFrameDetalleFormProcesoPreciosPorcentaje!=null) { this.isVisibilidadCeldaModificarProcesoPreciosPorcentaje=this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jButtonModificarToolBarProcesoPreciosPorcentaje.isVisible(); this.isVisibilidadCeldaActualizarProcesoPreciosPorcentaje=this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jButtonActualizarToolBarProcesoPreciosPorcentaje.isVisible(); this.isVisibilidadCeldaEliminarProcesoPreciosPorcentaje=this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jButtonEliminarToolBarProcesoPreciosPorcentaje.isVisible(); this.isVisibilidadCeldaCancelarProcesoPreciosPorcentaje=this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jButtonCancelarToolBarProcesoPreciosPorcentaje.isVisible(); } this.isVisibilidadCeldaGuardarProcesoPreciosPorcentaje=this.jButtonGuardarCambiosToolBarProcesoPreciosPorcentaje.isVisible(); this.isVisibilidadCeldaGuardarCambiosProcesoPreciosPorcentaje=this.jButtonGuardarCambiosTablaToolBarProcesoPreciosPorcentaje.isVisible(); //TOOLBAR //MENUS this.isVisibilidadCeldaNuevoProcesoPreciosPorcentaje=this.jMenuItemNuevoProcesoPreciosPorcentaje.isVisible(); this.isVisibilidadCeldaNuevoRelacionesProcesoPreciosPorcentaje=this.jMenuItemNuevoRelacionesProcesoPreciosPorcentaje.isVisible(); if(this.jInternalFrameDetalleFormProcesoPreciosPorcentaje!=null) { this.isVisibilidadCeldaModificarProcesoPreciosPorcentaje=this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jMenuItemModificarProcesoPreciosPorcentaje.isVisible(); this.isVisibilidadCeldaActualizarProcesoPreciosPorcentaje=this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jMenuItemActualizarProcesoPreciosPorcentaje.isVisible(); this.isVisibilidadCeldaEliminarProcesoPreciosPorcentaje=this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jMenuItemEliminarProcesoPreciosPorcentaje.isVisible(); this.isVisibilidadCeldaCancelarProcesoPreciosPorcentaje=this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jMenuItemCancelarProcesoPreciosPorcentaje.isVisible(); } this.isVisibilidadCeldaGuardarProcesoPreciosPorcentaje=this.jMenuItemGuardarCambiosProcesoPreciosPorcentaje.isVisible(); this.isVisibilidadCeldaGuardarCambiosProcesoPreciosPorcentaje=this.jMenuItemGuardarCambiosTablaProcesoPreciosPorcentaje.isVisible(); //MENUS } } public void inicializarActualizarBindingBotonesProcesoPreciosPorcentaje(Boolean esInicializar) { if(ProcesoPreciosPorcentajeJInternalFrame.ISBINDING_MANUAL) { if(this.procesopreciosporcentajeSessionBean.getConGuardarRelaciones()) { //if(this.procesopreciosporcentajeSessionBean.getEsGuardarRelacionado()) { this.actualizarEstadoCeldasBotonesConGuardarRelacionesProcesoPreciosPorcentaje(); } this.inicializarActualizarBindingBotonesManualProcesoPreciosPorcentaje(true); } else { } } public void inicializarActualizarBindingBotonesPermisosManualProcesoPreciosPorcentaje() { this.jButtonNuevoProcesoPreciosPorcentaje.setVisible(this.isPermisoNuevoProcesoPreciosPorcentaje); this.jButtonDuplicarProcesoPreciosPorcentaje.setVisible(this.isPermisoDuplicarProcesoPreciosPorcentaje); this.jButtonCopiarProcesoPreciosPorcentaje.setVisible(this.isPermisoCopiarProcesoPreciosPorcentaje); this.jButtonVerFormProcesoPreciosPorcentaje.setVisible(this.isPermisoVerFormProcesoPreciosPorcentaje); this.jButtonAbrirOrderByProcesoPreciosPorcentaje.setVisible(this.isPermisoOrdenProcesoPreciosPorcentaje); this.jButtonNuevoRelacionesProcesoPreciosPorcentaje.setVisible(this.isPermisoNuevoProcesoPreciosPorcentaje); if(this.jInternalFrameDetalleFormProcesoPreciosPorcentaje!=null) { //if(this.conCargarFormDetalle) { this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jButtonModificarProcesoPreciosPorcentaje.setVisible(this.isPermisoActualizarProcesoPreciosPorcentaje); this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jButtonActualizarProcesoPreciosPorcentaje.setVisible(this.isPermisoActualizarProcesoPreciosPorcentaje); this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jButtonEliminarProcesoPreciosPorcentaje.setVisible(this.isPermisoEliminarProcesoPreciosPorcentaje); this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jButtonCancelarProcesoPreciosPorcentaje.setVisible(this.isVisibilidadCeldaCancelarProcesoPreciosPorcentaje); this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jButtonGuardarCambiosProcesoPreciosPorcentaje.setVisible(this.isPermisoGuardarCambiosProcesoPreciosPorcentaje); } this.jButtonGuardarCambiosTablaProcesoPreciosPorcentaje.setVisible(this.isPermisoActualizarProcesoPreciosPorcentaje); } public void inicializarActualizarBindingBotonesPermisosManualFormDetalleProcesoPreciosPorcentaje() { this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jButtonModificarProcesoPreciosPorcentaje.setVisible(this.isPermisoActualizarProcesoPreciosPorcentaje); this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jButtonActualizarProcesoPreciosPorcentaje.setVisible(this.isPermisoActualizarProcesoPreciosPorcentaje); this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jButtonEliminarProcesoPreciosPorcentaje.setVisible(this.isPermisoEliminarProcesoPreciosPorcentaje); this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jButtonCancelarProcesoPreciosPorcentaje.setVisible(this.isVisibilidadCeldaCancelarProcesoPreciosPorcentaje); this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jButtonGuardarCambiosProcesoPreciosPorcentaje.setVisible((this.isVisibilidadCeldaGuardarProcesoPreciosPorcentaje && this.isPermisoGuardarCambiosProcesoPreciosPorcentaje)); } public void inicializarActualizarBindingBotonesPermisosProcesoPreciosPorcentaje() { if(ProcesoPreciosPorcentajeJInternalFrame.ISBINDING_MANUAL) { this.inicializarActualizarBindingBotonesPermisosManualProcesoPreciosPorcentaje(); } else { } } public void refrescarBindingBotonesProcesoPreciosPorcentaje() { } public void jTableDatosProcesoPreciosPorcentajeListSelectionListener(javax.swing.event.ListSelectionEvent evt) throws Exception { try { this.seleccionarProcesoPreciosPorcentaje(null,evt,-1); } catch(Exception e) { FuncionesSwing.manageException(this, e,logger,ProcesoPreciosPorcentajeConstantesFunciones.CLASSNAME); } } public void jButtonidProcesoPreciosPorcentajeBusquedaActionPerformed(java.awt.event.ActionEvent evt) throws Exception { try { if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.getNewConnexionToDeep(""); } //TOCA TRAER NUEVAMENTE, YA QUE SE PIERDE REGISTRO ACTUAL int intSelectedRow = this.jTableDatosProcesoPreciosPorcentaje.getSelectedRow(); if(intSelectedRow>-1) { this.setVariablesFormularioToObjetoActualProcesoPreciosPorcentaje(this.getprocesopreciosporcentaje(),true); this.setVariablesFormularioToObjetoActualForeignKeysProcesoPreciosPorcentaje(this.procesopreciosporcentaje); //ARCHITECTURE /* if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentaje =(ProcesoPreciosPorcentaje) this.procesopreciosporcentajeLogic.getProcesoPreciosPorcentajes().toArray()[this.jTableDatosProcesoPreciosPorcentaje.convertRowIndexToModel(intSelectedRow)]; } else if(Constantes.ISUSAEJBREMOTE || Constantes.ISUSAEJBHOME) { this.procesopreciosporcentaje =(ProcesoPreciosPorcentaje) this.procesopreciosporcentajes.toArray()[this.jTableDatosProcesoPreciosPorcentaje.convertRowIndexToModel(intSelectedRow)]; } */ //ARCHITECTURE } else { if(this.procesopreciosporcentaje==null) { this.procesopreciosporcentaje = new ProcesoPreciosPorcentaje(); } this.setVariablesFormularioToObjetoActualProcesoPreciosPorcentaje(this.procesopreciosporcentaje,true); this.setVariablesFormularioToObjetoActualForeignKeysProcesoPreciosPorcentaje(this.procesopreciosporcentaje); } if(this.procesopreciosporcentaje.getId()!=null) { this.sAccionBusqueda="Query"; this.sFinalQueryGeneral=" where id = "+this.procesopreciosporcentaje.getId().toString()+" "; if(Constantes.ISDEVELOPING) { System.out.println(this.sFinalQueryGeneral); } this.procesarBusqueda(this.sAccionBusqueda); this.inicializarActualizarBindingProcesoPreciosPorcentaje(false); } if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.commitNewConnexionToDeep(); } } catch(Exception e) { if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.rollbackNewConnexionToDeep(); } FuncionesSwing.manageException(this, e,logger,ProcesoPreciosPorcentajeConstantesFunciones.CLASSNAME); } finally { if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.closeNewConnexionToDeep(); } } } public void jButtonid_bodegaProcesoPreciosPorcentajeUpdateActionPerformed(java.awt.event.ActionEvent evt) throws Exception { try { if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.getNewConnexionToDeep(""); } Boolean idTienePermisobodega=true; idTienePermisobodega=this.tienePermisosUsuarioEnPaginaWebProcesoPreciosPorcentaje(BodegaConstantesFunciones.CLASSNAME); if(idTienePermisobodega) { //TOCA TRAER NUEVAMENTE, YA QUE SE PIERDE REGISTRO ACTUAL int intSelectedRow = this.jTableDatosProcesoPreciosPorcentaje.getSelectedRow(); if(intSelectedRow<0 && this.jTableDatosProcesoPreciosPorcentaje.getRowCount()>0) { intSelectedRow =0; this.jTableDatosProcesoPreciosPorcentaje.setRowSelectionInterval(intSelectedRow,intSelectedRow); } //ARCHITECTURE /* if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentaje =(ProcesoPreciosPorcentaje) this.procesopreciosporcentajeLogic.getProcesoPreciosPorcentajes().toArray()[this.jTableDatosProcesoPreciosPorcentaje.convertRowIndexToModel(intSelectedRow)]; } else if(Constantes.ISUSAEJBREMOTE || Constantes.ISUSAEJBHOME) { this.procesopreciosporcentaje =(ProcesoPreciosPorcentaje) this.procesopreciosporcentajes.toArray()[this.jTableDatosProcesoPreciosPorcentaje.convertRowIndexToModel(intSelectedRow)]; } */ //ARCHITECTURE this.setVariablesFormularioToObjetoActualProcesoPreciosPorcentaje(this.getprocesopreciosporcentaje(),true); this.setVariablesFormularioToObjetoActualForeignKeysProcesoPreciosPorcentaje(this.procesopreciosporcentaje); this.bodegaBeanSwingJInternalFrame=new BodegaBeanSwingJInternalFrame(true,true,this.jDesktopPane,this.usuarioActual,this.resumenUsuarioActual,this.moduloActual,this.opcionActual,this.parametroGeneralSg,this.parametroGeneralUsuario,PaginaTipo.AUXILIAR,false,false,false,true); this.bodegaBeanSwingJInternalFrame.setJInternalFrameParent(this); this.bodegaBeanSwingJInternalFrame.getBodegaLogic().setConnexion(this.procesopreciosporcentajeLogic.getConnexion()); if(this.procesopreciosporcentaje.getid_bodega()!=null) { this.bodegaBeanSwingJInternalFrame.sTipoBusqueda="PorId"; this.bodegaBeanSwingJInternalFrame.setIdActual(this.procesopreciosporcentaje.getid_bodega()); this.bodegaBeanSwingJInternalFrame.procesarBusqueda("PorId"); this.bodegaBeanSwingJInternalFrame.setsAccionBusqueda("PorId"); this.bodegaBeanSwingJInternalFrame.inicializarActualizarBindingTablaBodega(); } JInternalFrameBase jinternalFrame =this.bodegaBeanSwingJInternalFrame; jinternalFrame.setAutoscrolls(true); //frame.setSize(screenSize.width-inset*7 , screenSize.height-inset*9); jinternalFrame.setVisible(true); TitledBorder titledBorderProcesoPreciosPorcentaje=(TitledBorder)this.jScrollPanelDatosProcesoPreciosPorcentaje.getBorder(); TitledBorder titledBorderbodega=(TitledBorder)this.bodegaBeanSwingJInternalFrame.jScrollPanelDatosBodega.getBorder(); titledBorderbodega.setTitle(titledBorderProcesoPreciosPorcentaje.getTitle() + " -> Bodega"); if(!Constantes.CON_VARIAS_VENTANAS) { MainJFrame.cerrarJInternalFramesExistentes(this.jDesktopPane,jinternalFrame); } this.jDesktopPane.add(jinternalFrame); jinternalFrame.setSelected(true); } else { throw new Exception("NO TIENE PERMISO PARA TRABAJAR CON ESTA INFORMACION"); } if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.commitNewConnexionToDeep(); } } catch(Exception e) { if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.rollbackNewConnexionToDeep(); } FuncionesSwing.manageException(this, e,logger,ProcesoPreciosPorcentajeConstantesFunciones.CLASSNAME); } finally { if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.closeNewConnexionToDeep(); } } } public void jButtonid_bodegaProcesoPreciosPorcentajeBusquedaActionPerformed(java.awt.event.ActionEvent evt) throws Exception { try { if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.getNewConnexionToDeep(""); } //TOCA TRAER NUEVAMENTE, YA QUE SE PIERDE REGISTRO ACTUAL int intSelectedRow = this.jTableDatosProcesoPreciosPorcentaje.getSelectedRow(); if(intSelectedRow>-1) { this.setVariablesFormularioToObjetoActualProcesoPreciosPorcentaje(this.getprocesopreciosporcentaje(),true); this.setVariablesFormularioToObjetoActualForeignKeysProcesoPreciosPorcentaje(this.procesopreciosporcentaje); //ARCHITECTURE /* if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentaje =(ProcesoPreciosPorcentaje) this.procesopreciosporcentajeLogic.getProcesoPreciosPorcentajes().toArray()[this.jTableDatosProcesoPreciosPorcentaje.convertRowIndexToModel(intSelectedRow)]; } else if(Constantes.ISUSAEJBREMOTE || Constantes.ISUSAEJBHOME) { this.procesopreciosporcentaje =(ProcesoPreciosPorcentaje) this.procesopreciosporcentajes.toArray()[this.jTableDatosProcesoPreciosPorcentaje.convertRowIndexToModel(intSelectedRow)]; } */ //ARCHITECTURE } else { if(this.procesopreciosporcentaje==null) { this.procesopreciosporcentaje = new ProcesoPreciosPorcentaje(); } this.setVariablesFormularioToObjetoActualProcesoPreciosPorcentaje(this.procesopreciosporcentaje,true); this.setVariablesFormularioToObjetoActualForeignKeysProcesoPreciosPorcentaje(this.procesopreciosporcentaje); } if(this.procesopreciosporcentaje.getid_bodega()!=null) { this.sAccionBusqueda="Query"; this.sFinalQueryGeneral=" where id_bodega = "+this.procesopreciosporcentaje.getid_bodega().toString()+" "; if(Constantes.ISDEVELOPING) { System.out.println(this.sFinalQueryGeneral); } this.procesarBusqueda(this.sAccionBusqueda); this.inicializarActualizarBindingProcesoPreciosPorcentaje(false); } if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.commitNewConnexionToDeep(); } } catch(Exception e) { if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.rollbackNewConnexionToDeep(); } FuncionesSwing.manageException(this, e,logger,ProcesoPreciosPorcentajeConstantesFunciones.CLASSNAME); } finally { if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.closeNewConnexionToDeep(); } } } public void jButtonid_productoProcesoPreciosPorcentajeUpdateActionPerformed(java.awt.event.ActionEvent evt) throws Exception { try { if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.getNewConnexionToDeep(""); } Boolean idTienePermisoproducto=true; idTienePermisoproducto=this.tienePermisosUsuarioEnPaginaWebProcesoPreciosPorcentaje(ProductoConstantesFunciones.CLASSNAME); if(idTienePermisoproducto) { //TOCA TRAER NUEVAMENTE, YA QUE SE PIERDE REGISTRO ACTUAL int intSelectedRow = this.jTableDatosProcesoPreciosPorcentaje.getSelectedRow(); if(intSelectedRow<0 && this.jTableDatosProcesoPreciosPorcentaje.getRowCount()>0) { intSelectedRow =0; this.jTableDatosProcesoPreciosPorcentaje.setRowSelectionInterval(intSelectedRow,intSelectedRow); } //ARCHITECTURE /* if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentaje =(ProcesoPreciosPorcentaje) this.procesopreciosporcentajeLogic.getProcesoPreciosPorcentajes().toArray()[this.jTableDatosProcesoPreciosPorcentaje.convertRowIndexToModel(intSelectedRow)]; } else if(Constantes.ISUSAEJBREMOTE || Constantes.ISUSAEJBHOME) { this.procesopreciosporcentaje =(ProcesoPreciosPorcentaje) this.procesopreciosporcentajes.toArray()[this.jTableDatosProcesoPreciosPorcentaje.convertRowIndexToModel(intSelectedRow)]; } */ //ARCHITECTURE this.setVariablesFormularioToObjetoActualProcesoPreciosPorcentaje(this.getprocesopreciosporcentaje(),true); this.setVariablesFormularioToObjetoActualForeignKeysProcesoPreciosPorcentaje(this.procesopreciosporcentaje); this.productoBeanSwingJInternalFrame=new ProductoBeanSwingJInternalFrame(true,true,this.jDesktopPane,this.usuarioActual,this.resumenUsuarioActual,this.moduloActual,this.opcionActual,this.parametroGeneralSg,this.parametroGeneralUsuario,PaginaTipo.AUXILIAR,false,false,false,true); this.productoBeanSwingJInternalFrame.setJInternalFrameParent(this); this.productoBeanSwingJInternalFrame.getProductoLogic().setConnexion(this.procesopreciosporcentajeLogic.getConnexion()); if(this.procesopreciosporcentaje.getid_producto()!=null) { this.productoBeanSwingJInternalFrame.sTipoBusqueda="PorId"; this.productoBeanSwingJInternalFrame.setIdActual(this.procesopreciosporcentaje.getid_producto()); this.productoBeanSwingJInternalFrame.procesarBusqueda("PorId"); this.productoBeanSwingJInternalFrame.setsAccionBusqueda("PorId"); this.productoBeanSwingJInternalFrame.inicializarActualizarBindingTablaProducto(); } JInternalFrameBase jinternalFrame =this.productoBeanSwingJInternalFrame; jinternalFrame.setAutoscrolls(true); //frame.setSize(screenSize.width-inset*7 , screenSize.height-inset*9); jinternalFrame.setVisible(true); TitledBorder titledBorderProcesoPreciosPorcentaje=(TitledBorder)this.jScrollPanelDatosProcesoPreciosPorcentaje.getBorder(); TitledBorder titledBorderproducto=(TitledBorder)this.productoBeanSwingJInternalFrame.jScrollPanelDatosProducto.getBorder(); titledBorderproducto.setTitle(titledBorderProcesoPreciosPorcentaje.getTitle() + " -> Producto"); if(!Constantes.CON_VARIAS_VENTANAS) { MainJFrame.cerrarJInternalFramesExistentes(this.jDesktopPane,jinternalFrame); } this.jDesktopPane.add(jinternalFrame); jinternalFrame.setSelected(true); } else { throw new Exception("NO TIENE PERMISO PARA TRABAJAR CON ESTA INFORMACION"); } if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.commitNewConnexionToDeep(); } } catch(Exception e) { if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.rollbackNewConnexionToDeep(); } FuncionesSwing.manageException(this, e,logger,ProcesoPreciosPorcentajeConstantesFunciones.CLASSNAME); } finally { if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.closeNewConnexionToDeep(); } } } public void jButtonid_productoProcesoPreciosPorcentajeBusquedaActionPerformed(java.awt.event.ActionEvent evt) throws Exception { try { if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.getNewConnexionToDeep(""); } //TOCA TRAER NUEVAMENTE, YA QUE SE PIERDE REGISTRO ACTUAL int intSelectedRow = this.jTableDatosProcesoPreciosPorcentaje.getSelectedRow(); if(intSelectedRow>-1) { this.setVariablesFormularioToObjetoActualProcesoPreciosPorcentaje(this.getprocesopreciosporcentaje(),true); this.setVariablesFormularioToObjetoActualForeignKeysProcesoPreciosPorcentaje(this.procesopreciosporcentaje); //ARCHITECTURE /* if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentaje =(ProcesoPreciosPorcentaje) this.procesopreciosporcentajeLogic.getProcesoPreciosPorcentajes().toArray()[this.jTableDatosProcesoPreciosPorcentaje.convertRowIndexToModel(intSelectedRow)]; } else if(Constantes.ISUSAEJBREMOTE || Constantes.ISUSAEJBHOME) { this.procesopreciosporcentaje =(ProcesoPreciosPorcentaje) this.procesopreciosporcentajes.toArray()[this.jTableDatosProcesoPreciosPorcentaje.convertRowIndexToModel(intSelectedRow)]; } */ //ARCHITECTURE } else { if(this.procesopreciosporcentaje==null) { this.procesopreciosporcentaje = new ProcesoPreciosPorcentaje(); } this.setVariablesFormularioToObjetoActualProcesoPreciosPorcentaje(this.procesopreciosporcentaje,true); this.setVariablesFormularioToObjetoActualForeignKeysProcesoPreciosPorcentaje(this.procesopreciosporcentaje); } if(this.procesopreciosporcentaje.getid_producto()!=null) { this.sAccionBusqueda="Query"; this.sFinalQueryGeneral=" where id_producto = "+this.procesopreciosporcentaje.getid_producto().toString()+" "; if(Constantes.ISDEVELOPING) { System.out.println(this.sFinalQueryGeneral); } this.procesarBusqueda(this.sAccionBusqueda); this.inicializarActualizarBindingProcesoPreciosPorcentaje(false); } if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.commitNewConnexionToDeep(); } } catch(Exception e) { if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.rollbackNewConnexionToDeep(); } FuncionesSwing.manageException(this, e,logger,ProcesoPreciosPorcentajeConstantesFunciones.CLASSNAME); } finally { if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.closeNewConnexionToDeep(); } } } public void jButtonid_empresaProcesoPreciosPorcentajeUpdateActionPerformed(java.awt.event.ActionEvent evt) throws Exception { try { if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.getNewConnexionToDeep(""); } Boolean idTienePermisoempresa=true; idTienePermisoempresa=this.tienePermisosUsuarioEnPaginaWebProcesoPreciosPorcentaje(EmpresaConstantesFunciones.CLASSNAME); if(idTienePermisoempresa) { //TOCA TRAER NUEVAMENTE, YA QUE SE PIERDE REGISTRO ACTUAL int intSelectedRow = this.jTableDatosProcesoPreciosPorcentaje.getSelectedRow(); if(intSelectedRow<0 && this.jTableDatosProcesoPreciosPorcentaje.getRowCount()>0) { intSelectedRow =0; this.jTableDatosProcesoPreciosPorcentaje.setRowSelectionInterval(intSelectedRow,intSelectedRow); } //ARCHITECTURE /* if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentaje =(ProcesoPreciosPorcentaje) this.procesopreciosporcentajeLogic.getProcesoPreciosPorcentajes().toArray()[this.jTableDatosProcesoPreciosPorcentaje.convertRowIndexToModel(intSelectedRow)]; } else if(Constantes.ISUSAEJBREMOTE || Constantes.ISUSAEJBHOME) { this.procesopreciosporcentaje =(ProcesoPreciosPorcentaje) this.procesopreciosporcentajes.toArray()[this.jTableDatosProcesoPreciosPorcentaje.convertRowIndexToModel(intSelectedRow)]; } */ //ARCHITECTURE this.setVariablesFormularioToObjetoActualProcesoPreciosPorcentaje(this.getprocesopreciosporcentaje(),true); this.setVariablesFormularioToObjetoActualForeignKeysProcesoPreciosPorcentaje(this.procesopreciosporcentaje); this.empresaBeanSwingJInternalFrame=new EmpresaBeanSwingJInternalFrame(true,true,this.jDesktopPane,this.usuarioActual,this.resumenUsuarioActual,this.moduloActual,this.opcionActual,this.parametroGeneralSg,this.parametroGeneralUsuario,PaginaTipo.AUXILIAR,false,false,false,true); this.empresaBeanSwingJInternalFrame.setJInternalFrameParent(this); this.empresaBeanSwingJInternalFrame.getEmpresaLogic().setConnexion(this.procesopreciosporcentajeLogic.getConnexion()); if(this.procesopreciosporcentaje.getid_empresa()!=null) { this.empresaBeanSwingJInternalFrame.sTipoBusqueda="PorId"; this.empresaBeanSwingJInternalFrame.setIdActual(this.procesopreciosporcentaje.getid_empresa()); this.empresaBeanSwingJInternalFrame.procesarBusqueda("PorId"); this.empresaBeanSwingJInternalFrame.setsAccionBusqueda("PorId"); this.empresaBeanSwingJInternalFrame.inicializarActualizarBindingTablaEmpresa(); } JInternalFrameBase jinternalFrame =this.empresaBeanSwingJInternalFrame; jinternalFrame.setAutoscrolls(true); //frame.setSize(screenSize.width-inset*7 , screenSize.height-inset*9); jinternalFrame.setVisible(true); TitledBorder titledBorderProcesoPreciosPorcentaje=(TitledBorder)this.jScrollPanelDatosProcesoPreciosPorcentaje.getBorder(); TitledBorder titledBorderempresa=(TitledBorder)this.empresaBeanSwingJInternalFrame.jScrollPanelDatosEmpresa.getBorder(); titledBorderempresa.setTitle(titledBorderProcesoPreciosPorcentaje.getTitle() + " -> Empresa"); if(!Constantes.CON_VARIAS_VENTANAS) { MainJFrame.cerrarJInternalFramesExistentes(this.jDesktopPane,jinternalFrame); } this.jDesktopPane.add(jinternalFrame); jinternalFrame.setSelected(true); } else { throw new Exception("NO TIENE PERMISO PARA TRABAJAR CON ESTA INFORMACION"); } if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.commitNewConnexionToDeep(); } } catch(Exception e) { if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.rollbackNewConnexionToDeep(); } FuncionesSwing.manageException(this, e,logger,ProcesoPreciosPorcentajeConstantesFunciones.CLASSNAME); } finally { if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.closeNewConnexionToDeep(); } } } public void jButtonid_empresaProcesoPreciosPorcentajeBusquedaActionPerformed(java.awt.event.ActionEvent evt) throws Exception { try { if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.getNewConnexionToDeep(""); } //TOCA TRAER NUEVAMENTE, YA QUE SE PIERDE REGISTRO ACTUAL int intSelectedRow = this.jTableDatosProcesoPreciosPorcentaje.getSelectedRow(); if(intSelectedRow>-1) { this.setVariablesFormularioToObjetoActualProcesoPreciosPorcentaje(this.getprocesopreciosporcentaje(),true); this.setVariablesFormularioToObjetoActualForeignKeysProcesoPreciosPorcentaje(this.procesopreciosporcentaje); //ARCHITECTURE /* if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentaje =(ProcesoPreciosPorcentaje) this.procesopreciosporcentajeLogic.getProcesoPreciosPorcentajes().toArray()[this.jTableDatosProcesoPreciosPorcentaje.convertRowIndexToModel(intSelectedRow)]; } else if(Constantes.ISUSAEJBREMOTE || Constantes.ISUSAEJBHOME) { this.procesopreciosporcentaje =(ProcesoPreciosPorcentaje) this.procesopreciosporcentajes.toArray()[this.jTableDatosProcesoPreciosPorcentaje.convertRowIndexToModel(intSelectedRow)]; } */ //ARCHITECTURE } else { if(this.procesopreciosporcentaje==null) { this.procesopreciosporcentaje = new ProcesoPreciosPorcentaje(); } this.setVariablesFormularioToObjetoActualProcesoPreciosPorcentaje(this.procesopreciosporcentaje,true); this.setVariablesFormularioToObjetoActualForeignKeysProcesoPreciosPorcentaje(this.procesopreciosporcentaje); } if(this.procesopreciosporcentaje.getid_empresa()!=null) { this.sAccionBusqueda="Query"; this.sFinalQueryGeneral=" where id_empresa = "+this.procesopreciosporcentaje.getid_empresa().toString()+" "; if(Constantes.ISDEVELOPING) { System.out.println(this.sFinalQueryGeneral); } this.procesarBusqueda(this.sAccionBusqueda); this.inicializarActualizarBindingProcesoPreciosPorcentaje(false); } if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.commitNewConnexionToDeep(); } } catch(Exception e) { if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.rollbackNewConnexionToDeep(); } FuncionesSwing.manageException(this, e,logger,ProcesoPreciosPorcentajeConstantesFunciones.CLASSNAME); } finally { if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.closeNewConnexionToDeep(); } } } public void jButtonid_sucursalProcesoPreciosPorcentajeUpdateActionPerformed(java.awt.event.ActionEvent evt) throws Exception { try { if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.getNewConnexionToDeep(""); } Boolean idTienePermisosucursal=true; idTienePermisosucursal=this.tienePermisosUsuarioEnPaginaWebProcesoPreciosPorcentaje(SucursalConstantesFunciones.CLASSNAME); if(idTienePermisosucursal) { //TOCA TRAER NUEVAMENTE, YA QUE SE PIERDE REGISTRO ACTUAL int intSelectedRow = this.jTableDatosProcesoPreciosPorcentaje.getSelectedRow(); if(intSelectedRow<0 && this.jTableDatosProcesoPreciosPorcentaje.getRowCount()>0) { intSelectedRow =0; this.jTableDatosProcesoPreciosPorcentaje.setRowSelectionInterval(intSelectedRow,intSelectedRow); } //ARCHITECTURE /* if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentaje =(ProcesoPreciosPorcentaje) this.procesopreciosporcentajeLogic.getProcesoPreciosPorcentajes().toArray()[this.jTableDatosProcesoPreciosPorcentaje.convertRowIndexToModel(intSelectedRow)]; } else if(Constantes.ISUSAEJBREMOTE || Constantes.ISUSAEJBHOME) { this.procesopreciosporcentaje =(ProcesoPreciosPorcentaje) this.procesopreciosporcentajes.toArray()[this.jTableDatosProcesoPreciosPorcentaje.convertRowIndexToModel(intSelectedRow)]; } */ //ARCHITECTURE this.setVariablesFormularioToObjetoActualProcesoPreciosPorcentaje(this.getprocesopreciosporcentaje(),true); this.setVariablesFormularioToObjetoActualForeignKeysProcesoPreciosPorcentaje(this.procesopreciosporcentaje); this.sucursalBeanSwingJInternalFrame=new SucursalBeanSwingJInternalFrame(true,true,this.jDesktopPane,this.usuarioActual,this.resumenUsuarioActual,this.moduloActual,this.opcionActual,this.parametroGeneralSg,this.parametroGeneralUsuario,PaginaTipo.AUXILIAR,false,false,false,true); this.sucursalBeanSwingJInternalFrame.setJInternalFrameParent(this); this.sucursalBeanSwingJInternalFrame.getSucursalLogic().setConnexion(this.procesopreciosporcentajeLogic.getConnexion()); if(this.procesopreciosporcentaje.getid_sucursal()!=null) { this.sucursalBeanSwingJInternalFrame.sTipoBusqueda="PorId"; this.sucursalBeanSwingJInternalFrame.setIdActual(this.procesopreciosporcentaje.getid_sucursal()); this.sucursalBeanSwingJInternalFrame.procesarBusqueda("PorId"); this.sucursalBeanSwingJInternalFrame.setsAccionBusqueda("PorId"); this.sucursalBeanSwingJInternalFrame.inicializarActualizarBindingTablaSucursal(); } JInternalFrameBase jinternalFrame =this.sucursalBeanSwingJInternalFrame; jinternalFrame.setAutoscrolls(true); //frame.setSize(screenSize.width-inset*7 , screenSize.height-inset*9); jinternalFrame.setVisible(true); TitledBorder titledBorderProcesoPreciosPorcentaje=(TitledBorder)this.jScrollPanelDatosProcesoPreciosPorcentaje.getBorder(); TitledBorder titledBordersucursal=(TitledBorder)this.sucursalBeanSwingJInternalFrame.jScrollPanelDatosSucursal.getBorder(); titledBordersucursal.setTitle(titledBorderProcesoPreciosPorcentaje.getTitle() + " -> Sucursal"); if(!Constantes.CON_VARIAS_VENTANAS) { MainJFrame.cerrarJInternalFramesExistentes(this.jDesktopPane,jinternalFrame); } this.jDesktopPane.add(jinternalFrame); jinternalFrame.setSelected(true); } else { throw new Exception("NO TIENE PERMISO PARA TRABAJAR CON ESTA INFORMACION"); } if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.commitNewConnexionToDeep(); } } catch(Exception e) { if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.rollbackNewConnexionToDeep(); } FuncionesSwing.manageException(this, e,logger,ProcesoPreciosPorcentajeConstantesFunciones.CLASSNAME); } finally { if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.closeNewConnexionToDeep(); } } } public void jButtonid_sucursalProcesoPreciosPorcentajeBusquedaActionPerformed(java.awt.event.ActionEvent evt) throws Exception { try { if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.getNewConnexionToDeep(""); } //TOCA TRAER NUEVAMENTE, YA QUE SE PIERDE REGISTRO ACTUAL int intSelectedRow = this.jTableDatosProcesoPreciosPorcentaje.getSelectedRow(); if(intSelectedRow>-1) { this.setVariablesFormularioToObjetoActualProcesoPreciosPorcentaje(this.getprocesopreciosporcentaje(),true); this.setVariablesFormularioToObjetoActualForeignKeysProcesoPreciosPorcentaje(this.procesopreciosporcentaje); //ARCHITECTURE /* if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentaje =(ProcesoPreciosPorcentaje) this.procesopreciosporcentajeLogic.getProcesoPreciosPorcentajes().toArray()[this.jTableDatosProcesoPreciosPorcentaje.convertRowIndexToModel(intSelectedRow)]; } else if(Constantes.ISUSAEJBREMOTE || Constantes.ISUSAEJBHOME) { this.procesopreciosporcentaje =(ProcesoPreciosPorcentaje) this.procesopreciosporcentajes.toArray()[this.jTableDatosProcesoPreciosPorcentaje.convertRowIndexToModel(intSelectedRow)]; } */ //ARCHITECTURE } else { if(this.procesopreciosporcentaje==null) { this.procesopreciosporcentaje = new ProcesoPreciosPorcentaje(); } this.setVariablesFormularioToObjetoActualProcesoPreciosPorcentaje(this.procesopreciosporcentaje,true); this.setVariablesFormularioToObjetoActualForeignKeysProcesoPreciosPorcentaje(this.procesopreciosporcentaje); } if(this.procesopreciosporcentaje.getid_sucursal()!=null) { this.sAccionBusqueda="Query"; this.sFinalQueryGeneral=" where id_sucursal = "+this.procesopreciosporcentaje.getid_sucursal().toString()+" "; if(Constantes.ISDEVELOPING) { System.out.println(this.sFinalQueryGeneral); } this.procesarBusqueda(this.sAccionBusqueda); this.inicializarActualizarBindingProcesoPreciosPorcentaje(false); } if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.commitNewConnexionToDeep(); } } catch(Exception e) { if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.rollbackNewConnexionToDeep(); } FuncionesSwing.manageException(this, e,logger,ProcesoPreciosPorcentajeConstantesFunciones.CLASSNAME); } finally { if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.closeNewConnexionToDeep(); } } } public void jButtonid_lineaProcesoPreciosPorcentajeUpdateActionPerformed(java.awt.event.ActionEvent evt) throws Exception { try { if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.getNewConnexionToDeep(""); } Boolean idTienePermisolinea=true; idTienePermisolinea=this.tienePermisosUsuarioEnPaginaWebProcesoPreciosPorcentaje(LineaConstantesFunciones.CLASSNAME); if(idTienePermisolinea) { //TOCA TRAER NUEVAMENTE, YA QUE SE PIERDE REGISTRO ACTUAL int intSelectedRow = this.jTableDatosProcesoPreciosPorcentaje.getSelectedRow(); if(intSelectedRow<0 && this.jTableDatosProcesoPreciosPorcentaje.getRowCount()>0) { intSelectedRow =0; this.jTableDatosProcesoPreciosPorcentaje.setRowSelectionInterval(intSelectedRow,intSelectedRow); } //ARCHITECTURE /* if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentaje =(ProcesoPreciosPorcentaje) this.procesopreciosporcentajeLogic.getProcesoPreciosPorcentajes().toArray()[this.jTableDatosProcesoPreciosPorcentaje.convertRowIndexToModel(intSelectedRow)]; } else if(Constantes.ISUSAEJBREMOTE || Constantes.ISUSAEJBHOME) { this.procesopreciosporcentaje =(ProcesoPreciosPorcentaje) this.procesopreciosporcentajes.toArray()[this.jTableDatosProcesoPreciosPorcentaje.convertRowIndexToModel(intSelectedRow)]; } */ //ARCHITECTURE this.setVariablesFormularioToObjetoActualProcesoPreciosPorcentaje(this.getprocesopreciosporcentaje(),true); this.setVariablesFormularioToObjetoActualForeignKeysProcesoPreciosPorcentaje(this.procesopreciosporcentaje); this.lineaBeanSwingJInternalFrame=new LineaBeanSwingJInternalFrame(true,true,this.jDesktopPane,this.usuarioActual,this.resumenUsuarioActual,this.moduloActual,this.opcionActual,this.parametroGeneralSg,this.parametroGeneralUsuario,PaginaTipo.AUXILIAR,false,false,false,true); this.lineaBeanSwingJInternalFrame.setJInternalFrameParent(this); this.lineaBeanSwingJInternalFrame.getLineaLogic().setConnexion(this.procesopreciosporcentajeLogic.getConnexion()); if(this.procesopreciosporcentaje.getid_linea()!=null) { this.lineaBeanSwingJInternalFrame.sTipoBusqueda="PorId"; this.lineaBeanSwingJInternalFrame.setIdActual(this.procesopreciosporcentaje.getid_linea()); this.lineaBeanSwingJInternalFrame.procesarBusqueda("PorId"); this.lineaBeanSwingJInternalFrame.setsAccionBusqueda("PorId"); this.lineaBeanSwingJInternalFrame.inicializarActualizarBindingTablaLinea(); } JInternalFrameBase jinternalFrame =this.lineaBeanSwingJInternalFrame; jinternalFrame.setAutoscrolls(true); //frame.setSize(screenSize.width-inset*7 , screenSize.height-inset*9); jinternalFrame.setVisible(true); TitledBorder titledBorderProcesoPreciosPorcentaje=(TitledBorder)this.jScrollPanelDatosProcesoPreciosPorcentaje.getBorder(); TitledBorder titledBorderlinea=(TitledBorder)this.lineaBeanSwingJInternalFrame.jScrollPanelDatosLinea.getBorder(); titledBorderlinea.setTitle(titledBorderProcesoPreciosPorcentaje.getTitle() + " -> Linea"); if(!Constantes.CON_VARIAS_VENTANAS) { MainJFrame.cerrarJInternalFramesExistentes(this.jDesktopPane,jinternalFrame); } this.jDesktopPane.add(jinternalFrame); jinternalFrame.setSelected(true); } else { throw new Exception("NO TIENE PERMISO PARA TRABAJAR CON ESTA INFORMACION"); } if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.commitNewConnexionToDeep(); } } catch(Exception e) { if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.rollbackNewConnexionToDeep(); } FuncionesSwing.manageException(this, e,logger,ProcesoPreciosPorcentajeConstantesFunciones.CLASSNAME); } finally { if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.closeNewConnexionToDeep(); } } } public void jButtonid_lineaProcesoPreciosPorcentajeBusquedaActionPerformed(java.awt.event.ActionEvent evt) throws Exception { try { if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.getNewConnexionToDeep(""); } //TOCA TRAER NUEVAMENTE, YA QUE SE PIERDE REGISTRO ACTUAL int intSelectedRow = this.jTableDatosProcesoPreciosPorcentaje.getSelectedRow(); if(intSelectedRow>-1) { this.setVariablesFormularioToObjetoActualProcesoPreciosPorcentaje(this.getprocesopreciosporcentaje(),true); this.setVariablesFormularioToObjetoActualForeignKeysProcesoPreciosPorcentaje(this.procesopreciosporcentaje); //ARCHITECTURE /* if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentaje =(ProcesoPreciosPorcentaje) this.procesopreciosporcentajeLogic.getProcesoPreciosPorcentajes().toArray()[this.jTableDatosProcesoPreciosPorcentaje.convertRowIndexToModel(intSelectedRow)]; } else if(Constantes.ISUSAEJBREMOTE || Constantes.ISUSAEJBHOME) { this.procesopreciosporcentaje =(ProcesoPreciosPorcentaje) this.procesopreciosporcentajes.toArray()[this.jTableDatosProcesoPreciosPorcentaje.convertRowIndexToModel(intSelectedRow)]; } */ //ARCHITECTURE } else { if(this.procesopreciosporcentaje==null) { this.procesopreciosporcentaje = new ProcesoPreciosPorcentaje(); } this.setVariablesFormularioToObjetoActualProcesoPreciosPorcentaje(this.procesopreciosporcentaje,true); this.setVariablesFormularioToObjetoActualForeignKeysProcesoPreciosPorcentaje(this.procesopreciosporcentaje); } if(this.procesopreciosporcentaje.getid_linea()!=null) { this.sAccionBusqueda="Query"; this.sFinalQueryGeneral=" where id_linea = "+this.procesopreciosporcentaje.getid_linea().toString()+" "; if(Constantes.ISDEVELOPING) { System.out.println(this.sFinalQueryGeneral); } this.procesarBusqueda(this.sAccionBusqueda); this.inicializarActualizarBindingProcesoPreciosPorcentaje(false); } if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.commitNewConnexionToDeep(); } } catch(Exception e) { if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.rollbackNewConnexionToDeep(); } FuncionesSwing.manageException(this, e,logger,ProcesoPreciosPorcentajeConstantesFunciones.CLASSNAME); } finally { if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.closeNewConnexionToDeep(); } } } public void jButtonid_linea_grupoProcesoPreciosPorcentajeUpdateActionPerformed(java.awt.event.ActionEvent evt) throws Exception { try { if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.getNewConnexionToDeep(""); } Boolean idTienePermisolineagrupo=true; idTienePermisolineagrupo=this.tienePermisosUsuarioEnPaginaWebProcesoPreciosPorcentaje(LineaConstantesFunciones.CLASSNAME); if(idTienePermisolineagrupo) { //TOCA TRAER NUEVAMENTE, YA QUE SE PIERDE REGISTRO ACTUAL int intSelectedRow = this.jTableDatosProcesoPreciosPorcentaje.getSelectedRow(); if(intSelectedRow<0 && this.jTableDatosProcesoPreciosPorcentaje.getRowCount()>0) { intSelectedRow =0; this.jTableDatosProcesoPreciosPorcentaje.setRowSelectionInterval(intSelectedRow,intSelectedRow); } //ARCHITECTURE /* if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentaje =(ProcesoPreciosPorcentaje) this.procesopreciosporcentajeLogic.getProcesoPreciosPorcentajes().toArray()[this.jTableDatosProcesoPreciosPorcentaje.convertRowIndexToModel(intSelectedRow)]; } else if(Constantes.ISUSAEJBREMOTE || Constantes.ISUSAEJBHOME) { this.procesopreciosporcentaje =(ProcesoPreciosPorcentaje) this.procesopreciosporcentajes.toArray()[this.jTableDatosProcesoPreciosPorcentaje.convertRowIndexToModel(intSelectedRow)]; } */ //ARCHITECTURE this.setVariablesFormularioToObjetoActualProcesoPreciosPorcentaje(this.getprocesopreciosporcentaje(),true); this.setVariablesFormularioToObjetoActualForeignKeysProcesoPreciosPorcentaje(this.procesopreciosporcentaje); this.lineagrupoBeanSwingJInternalFrame=new LineaBeanSwingJInternalFrame(true,true,this.jDesktopPane,this.usuarioActual,this.resumenUsuarioActual,this.moduloActual,this.opcionActual,this.parametroGeneralSg,this.parametroGeneralUsuario,PaginaTipo.AUXILIAR,false,false,false,true); this.lineagrupoBeanSwingJInternalFrame.setJInternalFrameParent(this); this.lineagrupoBeanSwingJInternalFrame.getLineaLogic().setConnexion(this.procesopreciosporcentajeLogic.getConnexion()); if(this.procesopreciosporcentaje.getid_linea_grupo()!=null) { this.lineagrupoBeanSwingJInternalFrame.sTipoBusqueda="PorId"; this.lineagrupoBeanSwingJInternalFrame.setIdActual(this.procesopreciosporcentaje.getid_linea_grupo()); this.lineagrupoBeanSwingJInternalFrame.procesarBusqueda("PorId"); this.lineagrupoBeanSwingJInternalFrame.setsAccionBusqueda("PorId"); this.lineagrupoBeanSwingJInternalFrame.inicializarActualizarBindingTablaLinea(); } JInternalFrameBase jinternalFrame =this.lineagrupoBeanSwingJInternalFrame; jinternalFrame.setAutoscrolls(true); //frame.setSize(screenSize.width-inset*7 , screenSize.height-inset*9); jinternalFrame.setVisible(true); TitledBorder titledBorderProcesoPreciosPorcentaje=(TitledBorder)this.jScrollPanelDatosProcesoPreciosPorcentaje.getBorder(); TitledBorder titledBorderlineagrupo=(TitledBorder)this.lineagrupoBeanSwingJInternalFrame.jScrollPanelDatosLinea.getBorder(); titledBorderlineagrupo.setTitle(titledBorderProcesoPreciosPorcentaje.getTitle() + " -> Linea"); if(!Constantes.CON_VARIAS_VENTANAS) { MainJFrame.cerrarJInternalFramesExistentes(this.jDesktopPane,jinternalFrame); } this.jDesktopPane.add(jinternalFrame); jinternalFrame.setSelected(true); } else { throw new Exception("NO TIENE PERMISO PARA TRABAJAR CON ESTA INFORMACION"); } if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.commitNewConnexionToDeep(); } } catch(Exception e) { if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.rollbackNewConnexionToDeep(); } FuncionesSwing.manageException(this, e,logger,ProcesoPreciosPorcentajeConstantesFunciones.CLASSNAME); } finally { if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.closeNewConnexionToDeep(); } } } public void jButtonid_linea_grupoProcesoPreciosPorcentajeBusquedaActionPerformed(java.awt.event.ActionEvent evt) throws Exception { try { if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.getNewConnexionToDeep(""); } //TOCA TRAER NUEVAMENTE, YA QUE SE PIERDE REGISTRO ACTUAL int intSelectedRow = this.jTableDatosProcesoPreciosPorcentaje.getSelectedRow(); if(intSelectedRow>-1) { this.setVariablesFormularioToObjetoActualProcesoPreciosPorcentaje(this.getprocesopreciosporcentaje(),true); this.setVariablesFormularioToObjetoActualForeignKeysProcesoPreciosPorcentaje(this.procesopreciosporcentaje); //ARCHITECTURE /* if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentaje =(ProcesoPreciosPorcentaje) this.procesopreciosporcentajeLogic.getProcesoPreciosPorcentajes().toArray()[this.jTableDatosProcesoPreciosPorcentaje.convertRowIndexToModel(intSelectedRow)]; } else if(Constantes.ISUSAEJBREMOTE || Constantes.ISUSAEJBHOME) { this.procesopreciosporcentaje =(ProcesoPreciosPorcentaje) this.procesopreciosporcentajes.toArray()[this.jTableDatosProcesoPreciosPorcentaje.convertRowIndexToModel(intSelectedRow)]; } */ //ARCHITECTURE } else { if(this.procesopreciosporcentaje==null) { this.procesopreciosporcentaje = new ProcesoPreciosPorcentaje(); } this.setVariablesFormularioToObjetoActualProcesoPreciosPorcentaje(this.procesopreciosporcentaje,true); this.setVariablesFormularioToObjetoActualForeignKeysProcesoPreciosPorcentaje(this.procesopreciosporcentaje); } if(this.procesopreciosporcentaje.getid_linea_grupo()!=null) { this.sAccionBusqueda="Query"; this.sFinalQueryGeneral=" where id_linea_grupo = "+this.procesopreciosporcentaje.getid_linea_grupo().toString()+" "; if(Constantes.ISDEVELOPING) { System.out.println(this.sFinalQueryGeneral); } this.procesarBusqueda(this.sAccionBusqueda); this.inicializarActualizarBindingProcesoPreciosPorcentaje(false); } if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.commitNewConnexionToDeep(); } } catch(Exception e) { if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.rollbackNewConnexionToDeep(); } FuncionesSwing.manageException(this, e,logger,ProcesoPreciosPorcentajeConstantesFunciones.CLASSNAME); } finally { if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.closeNewConnexionToDeep(); } } } public void jButtonid_linea_categoriaProcesoPreciosPorcentajeUpdateActionPerformed(java.awt.event.ActionEvent evt) throws Exception { try { if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.getNewConnexionToDeep(""); } Boolean idTienePermisolineacategoria=true; idTienePermisolineacategoria=this.tienePermisosUsuarioEnPaginaWebProcesoPreciosPorcentaje(LineaConstantesFunciones.CLASSNAME); if(idTienePermisolineacategoria) { //TOCA TRAER NUEVAMENTE, YA QUE SE PIERDE REGISTRO ACTUAL int intSelectedRow = this.jTableDatosProcesoPreciosPorcentaje.getSelectedRow(); if(intSelectedRow<0 && this.jTableDatosProcesoPreciosPorcentaje.getRowCount()>0) { intSelectedRow =0; this.jTableDatosProcesoPreciosPorcentaje.setRowSelectionInterval(intSelectedRow,intSelectedRow); } //ARCHITECTURE /* if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentaje =(ProcesoPreciosPorcentaje) this.procesopreciosporcentajeLogic.getProcesoPreciosPorcentajes().toArray()[this.jTableDatosProcesoPreciosPorcentaje.convertRowIndexToModel(intSelectedRow)]; } else if(Constantes.ISUSAEJBREMOTE || Constantes.ISUSAEJBHOME) { this.procesopreciosporcentaje =(ProcesoPreciosPorcentaje) this.procesopreciosporcentajes.toArray()[this.jTableDatosProcesoPreciosPorcentaje.convertRowIndexToModel(intSelectedRow)]; } */ //ARCHITECTURE this.setVariablesFormularioToObjetoActualProcesoPreciosPorcentaje(this.getprocesopreciosporcentaje(),true); this.setVariablesFormularioToObjetoActualForeignKeysProcesoPreciosPorcentaje(this.procesopreciosporcentaje); this.lineacategoriaBeanSwingJInternalFrame=new LineaBeanSwingJInternalFrame(true,true,this.jDesktopPane,this.usuarioActual,this.resumenUsuarioActual,this.moduloActual,this.opcionActual,this.parametroGeneralSg,this.parametroGeneralUsuario,PaginaTipo.AUXILIAR,false,false,false,true); this.lineacategoriaBeanSwingJInternalFrame.setJInternalFrameParent(this); this.lineacategoriaBeanSwingJInternalFrame.getLineaLogic().setConnexion(this.procesopreciosporcentajeLogic.getConnexion()); if(this.procesopreciosporcentaje.getid_linea_categoria()!=null) { this.lineacategoriaBeanSwingJInternalFrame.sTipoBusqueda="PorId"; this.lineacategoriaBeanSwingJInternalFrame.setIdActual(this.procesopreciosporcentaje.getid_linea_categoria()); this.lineacategoriaBeanSwingJInternalFrame.procesarBusqueda("PorId"); this.lineacategoriaBeanSwingJInternalFrame.setsAccionBusqueda("PorId"); this.lineacategoriaBeanSwingJInternalFrame.inicializarActualizarBindingTablaLinea(); } JInternalFrameBase jinternalFrame =this.lineacategoriaBeanSwingJInternalFrame; jinternalFrame.setAutoscrolls(true); //frame.setSize(screenSize.width-inset*7 , screenSize.height-inset*9); jinternalFrame.setVisible(true); TitledBorder titledBorderProcesoPreciosPorcentaje=(TitledBorder)this.jScrollPanelDatosProcesoPreciosPorcentaje.getBorder(); TitledBorder titledBorderlineacategoria=(TitledBorder)this.lineacategoriaBeanSwingJInternalFrame.jScrollPanelDatosLinea.getBorder(); titledBorderlineacategoria.setTitle(titledBorderProcesoPreciosPorcentaje.getTitle() + " -> Linea"); if(!Constantes.CON_VARIAS_VENTANAS) { MainJFrame.cerrarJInternalFramesExistentes(this.jDesktopPane,jinternalFrame); } this.jDesktopPane.add(jinternalFrame); jinternalFrame.setSelected(true); } else { throw new Exception("NO TIENE PERMISO PARA TRABAJAR CON ESTA INFORMACION"); } if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.commitNewConnexionToDeep(); } } catch(Exception e) { if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.rollbackNewConnexionToDeep(); } FuncionesSwing.manageException(this, e,logger,ProcesoPreciosPorcentajeConstantesFunciones.CLASSNAME); } finally { if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.closeNewConnexionToDeep(); } } } public void jButtonid_linea_categoriaProcesoPreciosPorcentajeBusquedaActionPerformed(java.awt.event.ActionEvent evt) throws Exception { try { if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.getNewConnexionToDeep(""); } //TOCA TRAER NUEVAMENTE, YA QUE SE PIERDE REGISTRO ACTUAL int intSelectedRow = this.jTableDatosProcesoPreciosPorcentaje.getSelectedRow(); if(intSelectedRow>-1) { this.setVariablesFormularioToObjetoActualProcesoPreciosPorcentaje(this.getprocesopreciosporcentaje(),true); this.setVariablesFormularioToObjetoActualForeignKeysProcesoPreciosPorcentaje(this.procesopreciosporcentaje); //ARCHITECTURE /* if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentaje =(ProcesoPreciosPorcentaje) this.procesopreciosporcentajeLogic.getProcesoPreciosPorcentajes().toArray()[this.jTableDatosProcesoPreciosPorcentaje.convertRowIndexToModel(intSelectedRow)]; } else if(Constantes.ISUSAEJBREMOTE || Constantes.ISUSAEJBHOME) { this.procesopreciosporcentaje =(ProcesoPreciosPorcentaje) this.procesopreciosporcentajes.toArray()[this.jTableDatosProcesoPreciosPorcentaje.convertRowIndexToModel(intSelectedRow)]; } */ //ARCHITECTURE } else { if(this.procesopreciosporcentaje==null) { this.procesopreciosporcentaje = new ProcesoPreciosPorcentaje(); } this.setVariablesFormularioToObjetoActualProcesoPreciosPorcentaje(this.procesopreciosporcentaje,true); this.setVariablesFormularioToObjetoActualForeignKeysProcesoPreciosPorcentaje(this.procesopreciosporcentaje); } if(this.procesopreciosporcentaje.getid_linea_categoria()!=null) { this.sAccionBusqueda="Query"; this.sFinalQueryGeneral=" where id_linea_categoria = "+this.procesopreciosporcentaje.getid_linea_categoria().toString()+" "; if(Constantes.ISDEVELOPING) { System.out.println(this.sFinalQueryGeneral); } this.procesarBusqueda(this.sAccionBusqueda); this.inicializarActualizarBindingProcesoPreciosPorcentaje(false); } if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.commitNewConnexionToDeep(); } } catch(Exception e) { if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.rollbackNewConnexionToDeep(); } FuncionesSwing.manageException(this, e,logger,ProcesoPreciosPorcentajeConstantesFunciones.CLASSNAME); } finally { if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.closeNewConnexionToDeep(); } } } public void jButtonid_linea_marcaProcesoPreciosPorcentajeUpdateActionPerformed(java.awt.event.ActionEvent evt) throws Exception { try { if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.getNewConnexionToDeep(""); } Boolean idTienePermisolineamarca=true; idTienePermisolineamarca=this.tienePermisosUsuarioEnPaginaWebProcesoPreciosPorcentaje(LineaConstantesFunciones.CLASSNAME); if(idTienePermisolineamarca) { //TOCA TRAER NUEVAMENTE, YA QUE SE PIERDE REGISTRO ACTUAL int intSelectedRow = this.jTableDatosProcesoPreciosPorcentaje.getSelectedRow(); if(intSelectedRow<0 && this.jTableDatosProcesoPreciosPorcentaje.getRowCount()>0) { intSelectedRow =0; this.jTableDatosProcesoPreciosPorcentaje.setRowSelectionInterval(intSelectedRow,intSelectedRow); } //ARCHITECTURE /* if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentaje =(ProcesoPreciosPorcentaje) this.procesopreciosporcentajeLogic.getProcesoPreciosPorcentajes().toArray()[this.jTableDatosProcesoPreciosPorcentaje.convertRowIndexToModel(intSelectedRow)]; } else if(Constantes.ISUSAEJBREMOTE || Constantes.ISUSAEJBHOME) { this.procesopreciosporcentaje =(ProcesoPreciosPorcentaje) this.procesopreciosporcentajes.toArray()[this.jTableDatosProcesoPreciosPorcentaje.convertRowIndexToModel(intSelectedRow)]; } */ //ARCHITECTURE this.setVariablesFormularioToObjetoActualProcesoPreciosPorcentaje(this.getprocesopreciosporcentaje(),true); this.setVariablesFormularioToObjetoActualForeignKeysProcesoPreciosPorcentaje(this.procesopreciosporcentaje); this.lineamarcaBeanSwingJInternalFrame=new LineaBeanSwingJInternalFrame(true,true,this.jDesktopPane,this.usuarioActual,this.resumenUsuarioActual,this.moduloActual,this.opcionActual,this.parametroGeneralSg,this.parametroGeneralUsuario,PaginaTipo.AUXILIAR,false,false,false,true); this.lineamarcaBeanSwingJInternalFrame.setJInternalFrameParent(this); this.lineamarcaBeanSwingJInternalFrame.getLineaLogic().setConnexion(this.procesopreciosporcentajeLogic.getConnexion()); if(this.procesopreciosporcentaje.getid_linea_marca()!=null) { this.lineamarcaBeanSwingJInternalFrame.sTipoBusqueda="PorId"; this.lineamarcaBeanSwingJInternalFrame.setIdActual(this.procesopreciosporcentaje.getid_linea_marca()); this.lineamarcaBeanSwingJInternalFrame.procesarBusqueda("PorId"); this.lineamarcaBeanSwingJInternalFrame.setsAccionBusqueda("PorId"); this.lineamarcaBeanSwingJInternalFrame.inicializarActualizarBindingTablaLinea(); } JInternalFrameBase jinternalFrame =this.lineamarcaBeanSwingJInternalFrame; jinternalFrame.setAutoscrolls(true); //frame.setSize(screenSize.width-inset*7 , screenSize.height-inset*9); jinternalFrame.setVisible(true); TitledBorder titledBorderProcesoPreciosPorcentaje=(TitledBorder)this.jScrollPanelDatosProcesoPreciosPorcentaje.getBorder(); TitledBorder titledBorderlineamarca=(TitledBorder)this.lineamarcaBeanSwingJInternalFrame.jScrollPanelDatosLinea.getBorder(); titledBorderlineamarca.setTitle(titledBorderProcesoPreciosPorcentaje.getTitle() + " -> Linea"); if(!Constantes.CON_VARIAS_VENTANAS) { MainJFrame.cerrarJInternalFramesExistentes(this.jDesktopPane,jinternalFrame); } this.jDesktopPane.add(jinternalFrame); jinternalFrame.setSelected(true); } else { throw new Exception("NO TIENE PERMISO PARA TRABAJAR CON ESTA INFORMACION"); } if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.commitNewConnexionToDeep(); } } catch(Exception e) { if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.rollbackNewConnexionToDeep(); } FuncionesSwing.manageException(this, e,logger,ProcesoPreciosPorcentajeConstantesFunciones.CLASSNAME); } finally { if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.closeNewConnexionToDeep(); } } } public void jButtonid_linea_marcaProcesoPreciosPorcentajeBusquedaActionPerformed(java.awt.event.ActionEvent evt) throws Exception { try { if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.getNewConnexionToDeep(""); } //TOCA TRAER NUEVAMENTE, YA QUE SE PIERDE REGISTRO ACTUAL int intSelectedRow = this.jTableDatosProcesoPreciosPorcentaje.getSelectedRow(); if(intSelectedRow>-1) { this.setVariablesFormularioToObjetoActualProcesoPreciosPorcentaje(this.getprocesopreciosporcentaje(),true); this.setVariablesFormularioToObjetoActualForeignKeysProcesoPreciosPorcentaje(this.procesopreciosporcentaje); //ARCHITECTURE /* if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentaje =(ProcesoPreciosPorcentaje) this.procesopreciosporcentajeLogic.getProcesoPreciosPorcentajes().toArray()[this.jTableDatosProcesoPreciosPorcentaje.convertRowIndexToModel(intSelectedRow)]; } else if(Constantes.ISUSAEJBREMOTE || Constantes.ISUSAEJBHOME) { this.procesopreciosporcentaje =(ProcesoPreciosPorcentaje) this.procesopreciosporcentajes.toArray()[this.jTableDatosProcesoPreciosPorcentaje.convertRowIndexToModel(intSelectedRow)]; } */ //ARCHITECTURE } else { if(this.procesopreciosporcentaje==null) { this.procesopreciosporcentaje = new ProcesoPreciosPorcentaje(); } this.setVariablesFormularioToObjetoActualProcesoPreciosPorcentaje(this.procesopreciosporcentaje,true); this.setVariablesFormularioToObjetoActualForeignKeysProcesoPreciosPorcentaje(this.procesopreciosporcentaje); } if(this.procesopreciosporcentaje.getid_linea_marca()!=null) { this.sAccionBusqueda="Query"; this.sFinalQueryGeneral=" where id_linea_marca = "+this.procesopreciosporcentaje.getid_linea_marca().toString()+" "; if(Constantes.ISDEVELOPING) { System.out.println(this.sFinalQueryGeneral); } this.procesarBusqueda(this.sAccionBusqueda); this.inicializarActualizarBindingProcesoPreciosPorcentaje(false); } if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.commitNewConnexionToDeep(); } } catch(Exception e) { if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.rollbackNewConnexionToDeep(); } FuncionesSwing.manageException(this, e,logger,ProcesoPreciosPorcentajeConstantesFunciones.CLASSNAME); } finally { if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.closeNewConnexionToDeep(); } } } public void jButtoncodigoProcesoPreciosPorcentajeBusquedaActionPerformed(java.awt.event.ActionEvent evt) throws Exception { try { if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.getNewConnexionToDeep(""); } //TOCA TRAER NUEVAMENTE, YA QUE SE PIERDE REGISTRO ACTUAL int intSelectedRow = this.jTableDatosProcesoPreciosPorcentaje.getSelectedRow(); if(intSelectedRow>-1) { this.setVariablesFormularioToObjetoActualProcesoPreciosPorcentaje(this.getprocesopreciosporcentaje(),true); this.setVariablesFormularioToObjetoActualForeignKeysProcesoPreciosPorcentaje(this.procesopreciosporcentaje); //ARCHITECTURE /* if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentaje =(ProcesoPreciosPorcentaje) this.procesopreciosporcentajeLogic.getProcesoPreciosPorcentajes().toArray()[this.jTableDatosProcesoPreciosPorcentaje.convertRowIndexToModel(intSelectedRow)]; } else if(Constantes.ISUSAEJBREMOTE || Constantes.ISUSAEJBHOME) { this.procesopreciosporcentaje =(ProcesoPreciosPorcentaje) this.procesopreciosporcentajes.toArray()[this.jTableDatosProcesoPreciosPorcentaje.convertRowIndexToModel(intSelectedRow)]; } */ //ARCHITECTURE } else { if(this.procesopreciosporcentaje==null) { this.procesopreciosporcentaje = new ProcesoPreciosPorcentaje(); } this.setVariablesFormularioToObjetoActualProcesoPreciosPorcentaje(this.procesopreciosporcentaje,true); this.setVariablesFormularioToObjetoActualForeignKeysProcesoPreciosPorcentaje(this.procesopreciosporcentaje); } if(this.procesopreciosporcentaje.getcodigo()!=null) { this.sAccionBusqueda="Query"; this.sFinalQueryGeneral=" where codigo like '%"+this.procesopreciosporcentaje.getcodigo()+"%' "; if(Constantes.ISDEVELOPING) { System.out.println(this.sFinalQueryGeneral); } this.procesarBusqueda(this.sAccionBusqueda); this.inicializarActualizarBindingProcesoPreciosPorcentaje(false); } if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.commitNewConnexionToDeep(); } } catch(Exception e) { if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.rollbackNewConnexionToDeep(); } FuncionesSwing.manageException(this, e,logger,ProcesoPreciosPorcentajeConstantesFunciones.CLASSNAME); } finally { if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.closeNewConnexionToDeep(); } } } public void jButtonnombreProcesoPreciosPorcentajeBusquedaActionPerformed(java.awt.event.ActionEvent evt) throws Exception { try { if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.getNewConnexionToDeep(""); } //TOCA TRAER NUEVAMENTE, YA QUE SE PIERDE REGISTRO ACTUAL int intSelectedRow = this.jTableDatosProcesoPreciosPorcentaje.getSelectedRow(); if(intSelectedRow>-1) { this.setVariablesFormularioToObjetoActualProcesoPreciosPorcentaje(this.getprocesopreciosporcentaje(),true); this.setVariablesFormularioToObjetoActualForeignKeysProcesoPreciosPorcentaje(this.procesopreciosporcentaje); //ARCHITECTURE /* if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentaje =(ProcesoPreciosPorcentaje) this.procesopreciosporcentajeLogic.getProcesoPreciosPorcentajes().toArray()[this.jTableDatosProcesoPreciosPorcentaje.convertRowIndexToModel(intSelectedRow)]; } else if(Constantes.ISUSAEJBREMOTE || Constantes.ISUSAEJBHOME) { this.procesopreciosporcentaje =(ProcesoPreciosPorcentaje) this.procesopreciosporcentajes.toArray()[this.jTableDatosProcesoPreciosPorcentaje.convertRowIndexToModel(intSelectedRow)]; } */ //ARCHITECTURE } else { if(this.procesopreciosporcentaje==null) { this.procesopreciosporcentaje = new ProcesoPreciosPorcentaje(); } this.setVariablesFormularioToObjetoActualProcesoPreciosPorcentaje(this.procesopreciosporcentaje,true); this.setVariablesFormularioToObjetoActualForeignKeysProcesoPreciosPorcentaje(this.procesopreciosporcentaje); } if(this.procesopreciosporcentaje.getnombre()!=null) { this.sAccionBusqueda="Query"; this.sFinalQueryGeneral=" where nombre like '%"+this.procesopreciosporcentaje.getnombre()+"%' "; if(Constantes.ISDEVELOPING) { System.out.println(this.sFinalQueryGeneral); } this.procesarBusqueda(this.sAccionBusqueda); this.inicializarActualizarBindingProcesoPreciosPorcentaje(false); } if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.commitNewConnexionToDeep(); } } catch(Exception e) { if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.rollbackNewConnexionToDeep(); } FuncionesSwing.manageException(this, e,logger,ProcesoPreciosPorcentajeConstantesFunciones.CLASSNAME); } finally { if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.closeNewConnexionToDeep(); } } } public void jButtoncodigo_productoProcesoPreciosPorcentajeBusquedaActionPerformed(java.awt.event.ActionEvent evt) throws Exception { try { if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.getNewConnexionToDeep(""); } //TOCA TRAER NUEVAMENTE, YA QUE SE PIERDE REGISTRO ACTUAL int intSelectedRow = this.jTableDatosProcesoPreciosPorcentaje.getSelectedRow(); if(intSelectedRow>-1) { this.setVariablesFormularioToObjetoActualProcesoPreciosPorcentaje(this.getprocesopreciosporcentaje(),true); this.setVariablesFormularioToObjetoActualForeignKeysProcesoPreciosPorcentaje(this.procesopreciosporcentaje); //ARCHITECTURE /* if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentaje =(ProcesoPreciosPorcentaje) this.procesopreciosporcentajeLogic.getProcesoPreciosPorcentajes().toArray()[this.jTableDatosProcesoPreciosPorcentaje.convertRowIndexToModel(intSelectedRow)]; } else if(Constantes.ISUSAEJBREMOTE || Constantes.ISUSAEJBHOME) { this.procesopreciosporcentaje =(ProcesoPreciosPorcentaje) this.procesopreciosporcentajes.toArray()[this.jTableDatosProcesoPreciosPorcentaje.convertRowIndexToModel(intSelectedRow)]; } */ //ARCHITECTURE } else { if(this.procesopreciosporcentaje==null) { this.procesopreciosporcentaje = new ProcesoPreciosPorcentaje(); } this.setVariablesFormularioToObjetoActualProcesoPreciosPorcentaje(this.procesopreciosporcentaje,true); this.setVariablesFormularioToObjetoActualForeignKeysProcesoPreciosPorcentaje(this.procesopreciosporcentaje); } if(this.procesopreciosporcentaje.getcodigo_producto()!=null) { this.sAccionBusqueda="Query"; this.sFinalQueryGeneral=" where codigo_producto like '%"+this.procesopreciosporcentaje.getcodigo_producto()+"%' "; if(Constantes.ISDEVELOPING) { System.out.println(this.sFinalQueryGeneral); } this.procesarBusqueda(this.sAccionBusqueda); this.inicializarActualizarBindingProcesoPreciosPorcentaje(false); } if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.commitNewConnexionToDeep(); } } catch(Exception e) { if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.rollbackNewConnexionToDeep(); } FuncionesSwing.manageException(this, e,logger,ProcesoPreciosPorcentajeConstantesFunciones.CLASSNAME); } finally { if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.closeNewConnexionToDeep(); } } } public void jButtonnombre_productoProcesoPreciosPorcentajeBusquedaActionPerformed(java.awt.event.ActionEvent evt) throws Exception { try { if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.getNewConnexionToDeep(""); } //TOCA TRAER NUEVAMENTE, YA QUE SE PIERDE REGISTRO ACTUAL int intSelectedRow = this.jTableDatosProcesoPreciosPorcentaje.getSelectedRow(); if(intSelectedRow>-1) { this.setVariablesFormularioToObjetoActualProcesoPreciosPorcentaje(this.getprocesopreciosporcentaje(),true); this.setVariablesFormularioToObjetoActualForeignKeysProcesoPreciosPorcentaje(this.procesopreciosporcentaje); //ARCHITECTURE /* if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentaje =(ProcesoPreciosPorcentaje) this.procesopreciosporcentajeLogic.getProcesoPreciosPorcentajes().toArray()[this.jTableDatosProcesoPreciosPorcentaje.convertRowIndexToModel(intSelectedRow)]; } else if(Constantes.ISUSAEJBREMOTE || Constantes.ISUSAEJBHOME) { this.procesopreciosporcentaje =(ProcesoPreciosPorcentaje) this.procesopreciosporcentajes.toArray()[this.jTableDatosProcesoPreciosPorcentaje.convertRowIndexToModel(intSelectedRow)]; } */ //ARCHITECTURE } else { if(this.procesopreciosporcentaje==null) { this.procesopreciosporcentaje = new ProcesoPreciosPorcentaje(); } this.setVariablesFormularioToObjetoActualProcesoPreciosPorcentaje(this.procesopreciosporcentaje,true); this.setVariablesFormularioToObjetoActualForeignKeysProcesoPreciosPorcentaje(this.procesopreciosporcentaje); } if(this.procesopreciosporcentaje.getnombre_producto()!=null) { this.sAccionBusqueda="Query"; this.sFinalQueryGeneral=" where nombre_producto like '%"+this.procesopreciosporcentaje.getnombre_producto()+"%' "; if(Constantes.ISDEVELOPING) { System.out.println(this.sFinalQueryGeneral); } this.procesarBusqueda(this.sAccionBusqueda); this.inicializarActualizarBindingProcesoPreciosPorcentaje(false); } if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.commitNewConnexionToDeep(); } } catch(Exception e) { if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.rollbackNewConnexionToDeep(); } FuncionesSwing.manageException(this, e,logger,ProcesoPreciosPorcentajeConstantesFunciones.CLASSNAME); } finally { if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.closeNewConnexionToDeep(); } } } public void jButtonprecioProcesoPreciosPorcentajeBusquedaActionPerformed(java.awt.event.ActionEvent evt) throws Exception { try { if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.getNewConnexionToDeep(""); } //TOCA TRAER NUEVAMENTE, YA QUE SE PIERDE REGISTRO ACTUAL int intSelectedRow = this.jTableDatosProcesoPreciosPorcentaje.getSelectedRow(); if(intSelectedRow>-1) { this.setVariablesFormularioToObjetoActualProcesoPreciosPorcentaje(this.getprocesopreciosporcentaje(),true); this.setVariablesFormularioToObjetoActualForeignKeysProcesoPreciosPorcentaje(this.procesopreciosporcentaje); //ARCHITECTURE /* if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentaje =(ProcesoPreciosPorcentaje) this.procesopreciosporcentajeLogic.getProcesoPreciosPorcentajes().toArray()[this.jTableDatosProcesoPreciosPorcentaje.convertRowIndexToModel(intSelectedRow)]; } else if(Constantes.ISUSAEJBREMOTE || Constantes.ISUSAEJBHOME) { this.procesopreciosporcentaje =(ProcesoPreciosPorcentaje) this.procesopreciosporcentajes.toArray()[this.jTableDatosProcesoPreciosPorcentaje.convertRowIndexToModel(intSelectedRow)]; } */ //ARCHITECTURE } else { if(this.procesopreciosporcentaje==null) { this.procesopreciosporcentaje = new ProcesoPreciosPorcentaje(); } this.setVariablesFormularioToObjetoActualProcesoPreciosPorcentaje(this.procesopreciosporcentaje,true); this.setVariablesFormularioToObjetoActualForeignKeysProcesoPreciosPorcentaje(this.procesopreciosporcentaje); } if(this.procesopreciosporcentaje.getprecio()!=null) { this.sAccionBusqueda="Query"; this.sFinalQueryGeneral=" where precio = "+this.procesopreciosporcentaje.getprecio().toString()+" "; if(Constantes.ISDEVELOPING) { System.out.println(this.sFinalQueryGeneral); } this.procesarBusqueda(this.sAccionBusqueda); this.inicializarActualizarBindingProcesoPreciosPorcentaje(false); } if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.commitNewConnexionToDeep(); } } catch(Exception e) { if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.rollbackNewConnexionToDeep(); } FuncionesSwing.manageException(this, e,logger,ProcesoPreciosPorcentajeConstantesFunciones.CLASSNAME); } finally { if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.closeNewConnexionToDeep(); } } } public void jButtonporcentajeProcesoPreciosPorcentajeBusquedaActionPerformed(java.awt.event.ActionEvent evt) throws Exception { try { if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.getNewConnexionToDeep(""); } //TOCA TRAER NUEVAMENTE, YA QUE SE PIERDE REGISTRO ACTUAL int intSelectedRow = this.jTableDatosProcesoPreciosPorcentaje.getSelectedRow(); if(intSelectedRow>-1) { this.setVariablesFormularioToObjetoActualProcesoPreciosPorcentaje(this.getprocesopreciosporcentaje(),true); this.setVariablesFormularioToObjetoActualForeignKeysProcesoPreciosPorcentaje(this.procesopreciosporcentaje); //ARCHITECTURE /* if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentaje =(ProcesoPreciosPorcentaje) this.procesopreciosporcentajeLogic.getProcesoPreciosPorcentajes().toArray()[this.jTableDatosProcesoPreciosPorcentaje.convertRowIndexToModel(intSelectedRow)]; } else if(Constantes.ISUSAEJBREMOTE || Constantes.ISUSAEJBHOME) { this.procesopreciosporcentaje =(ProcesoPreciosPorcentaje) this.procesopreciosporcentajes.toArray()[this.jTableDatosProcesoPreciosPorcentaje.convertRowIndexToModel(intSelectedRow)]; } */ //ARCHITECTURE } else { if(this.procesopreciosporcentaje==null) { this.procesopreciosporcentaje = new ProcesoPreciosPorcentaje(); } this.setVariablesFormularioToObjetoActualProcesoPreciosPorcentaje(this.procesopreciosporcentaje,true); this.setVariablesFormularioToObjetoActualForeignKeysProcesoPreciosPorcentaje(this.procesopreciosporcentaje); } if(this.procesopreciosporcentaje.getporcentaje()!=null) { this.sAccionBusqueda="Query"; this.sFinalQueryGeneral=" where porcentaje = "+this.procesopreciosporcentaje.getporcentaje().toString()+" "; if(Constantes.ISDEVELOPING) { System.out.println(this.sFinalQueryGeneral); } this.procesarBusqueda(this.sAccionBusqueda); this.inicializarActualizarBindingProcesoPreciosPorcentaje(false); } if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.commitNewConnexionToDeep(); } } catch(Exception e) { if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.rollbackNewConnexionToDeep(); } FuncionesSwing.manageException(this, e,logger,ProcesoPreciosPorcentajeConstantesFunciones.CLASSNAME); } finally { if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.closeNewConnexionToDeep(); } } } public void jButtonBusquedaProcesoPreciosPorcentajeProcesoPreciosPorcentajeActionPerformed(ActionEvent evt) throws Exception { try { if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.getNewConnexionToDeep(""); } this.iNumeroPaginacionPagina=0; this.inicializarActualizarBindingProcesoPreciosPorcentaje(false,false); this.getProcesoPreciosPorcentajesBusquedaProcesoPreciosPorcentaje(); this.inicializarActualizarBindingProcesoPreciosPorcentaje(false); //if(ProcesoPreciosPorcentajeBeanSwingJInternalFrame.ISBINDING_MANUAL) { //this.inicializarActualizarBindingProcesoPreciosPorcentaje(false,false); //} if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.commitNewConnexionToDeep(); } } catch(Exception e) { if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.rollbackNewConnexionToDeep(); } FuncionesSwing.manageException(this, e,logger,ProcesoPreciosPorcentajeConstantesFunciones.CLASSNAME); } finally { if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.closeNewConnexionToDeep(); } } } public void jButtonFK_IdBodegaProcesoPreciosPorcentajeActionPerformed(ActionEvent evt) throws Exception { try { if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.getNewConnexionToDeep(""); } this.iNumeroPaginacionPagina=0; this.inicializarActualizarBindingProcesoPreciosPorcentaje(false,false); this.getProcesoPreciosPorcentajesFK_IdBodega(); this.inicializarActualizarBindingProcesoPreciosPorcentaje(false); //if(ProcesoPreciosPorcentajeBeanSwingJInternalFrame.ISBINDING_MANUAL) { //this.inicializarActualizarBindingProcesoPreciosPorcentaje(false,false); //} if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.commitNewConnexionToDeep(); } } catch(Exception e) { if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.rollbackNewConnexionToDeep(); } FuncionesSwing.manageException(this, e,logger,ProcesoPreciosPorcentajeConstantesFunciones.CLASSNAME); } finally { if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.closeNewConnexionToDeep(); } } } public void jButtonFK_IdEmpresaProcesoPreciosPorcentajeActionPerformed(ActionEvent evt) throws Exception { try { if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.getNewConnexionToDeep(""); } this.iNumeroPaginacionPagina=0; this.inicializarActualizarBindingProcesoPreciosPorcentaje(false,false); this.getProcesoPreciosPorcentajesFK_IdEmpresa(); this.inicializarActualizarBindingProcesoPreciosPorcentaje(false); //if(ProcesoPreciosPorcentajeBeanSwingJInternalFrame.ISBINDING_MANUAL) { //this.inicializarActualizarBindingProcesoPreciosPorcentaje(false,false); //} if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.commitNewConnexionToDeep(); } } catch(Exception e) { if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.rollbackNewConnexionToDeep(); } FuncionesSwing.manageException(this, e,logger,ProcesoPreciosPorcentajeConstantesFunciones.CLASSNAME); } finally { if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.closeNewConnexionToDeep(); } } } public void jButtonFK_IdLineaProcesoPreciosPorcentajeActionPerformed(ActionEvent evt) throws Exception { try { if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.getNewConnexionToDeep(""); } this.iNumeroPaginacionPagina=0; this.inicializarActualizarBindingProcesoPreciosPorcentaje(false,false); this.getProcesoPreciosPorcentajesFK_IdLinea(); this.inicializarActualizarBindingProcesoPreciosPorcentaje(false); //if(ProcesoPreciosPorcentajeBeanSwingJInternalFrame.ISBINDING_MANUAL) { //this.inicializarActualizarBindingProcesoPreciosPorcentaje(false,false); //} if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.commitNewConnexionToDeep(); } } catch(Exception e) { if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.rollbackNewConnexionToDeep(); } FuncionesSwing.manageException(this, e,logger,ProcesoPreciosPorcentajeConstantesFunciones.CLASSNAME); } finally { if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.closeNewConnexionToDeep(); } } } public void jButtonFK_IdLineaCategoriaProcesoPreciosPorcentajeActionPerformed(ActionEvent evt) throws Exception { try { if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.getNewConnexionToDeep(""); } this.iNumeroPaginacionPagina=0; this.inicializarActualizarBindingProcesoPreciosPorcentaje(false,false); this.getProcesoPreciosPorcentajesFK_IdLineaCategoria(); this.inicializarActualizarBindingProcesoPreciosPorcentaje(false); //if(ProcesoPreciosPorcentajeBeanSwingJInternalFrame.ISBINDING_MANUAL) { //this.inicializarActualizarBindingProcesoPreciosPorcentaje(false,false); //} if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.commitNewConnexionToDeep(); } } catch(Exception e) { if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.rollbackNewConnexionToDeep(); } FuncionesSwing.manageException(this, e,logger,ProcesoPreciosPorcentajeConstantesFunciones.CLASSNAME); } finally { if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.closeNewConnexionToDeep(); } } } public void jButtonFK_IdLineaGrupoProcesoPreciosPorcentajeActionPerformed(ActionEvent evt) throws Exception { try { if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.getNewConnexionToDeep(""); } this.iNumeroPaginacionPagina=0; this.inicializarActualizarBindingProcesoPreciosPorcentaje(false,false); this.getProcesoPreciosPorcentajesFK_IdLineaGrupo(); this.inicializarActualizarBindingProcesoPreciosPorcentaje(false); //if(ProcesoPreciosPorcentajeBeanSwingJInternalFrame.ISBINDING_MANUAL) { //this.inicializarActualizarBindingProcesoPreciosPorcentaje(false,false); //} if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.commitNewConnexionToDeep(); } } catch(Exception e) { if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.rollbackNewConnexionToDeep(); } FuncionesSwing.manageException(this, e,logger,ProcesoPreciosPorcentajeConstantesFunciones.CLASSNAME); } finally { if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.closeNewConnexionToDeep(); } } } public void jButtonFK_IdLineaMarcaProcesoPreciosPorcentajeActionPerformed(ActionEvent evt) throws Exception { try { if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.getNewConnexionToDeep(""); } this.iNumeroPaginacionPagina=0; this.inicializarActualizarBindingProcesoPreciosPorcentaje(false,false); this.getProcesoPreciosPorcentajesFK_IdLineaMarca(); this.inicializarActualizarBindingProcesoPreciosPorcentaje(false); //if(ProcesoPreciosPorcentajeBeanSwingJInternalFrame.ISBINDING_MANUAL) { //this.inicializarActualizarBindingProcesoPreciosPorcentaje(false,false); //} if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.commitNewConnexionToDeep(); } } catch(Exception e) { if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.rollbackNewConnexionToDeep(); } FuncionesSwing.manageException(this, e,logger,ProcesoPreciosPorcentajeConstantesFunciones.CLASSNAME); } finally { if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.closeNewConnexionToDeep(); } } } public void jButtonFK_IdProductoProcesoPreciosPorcentajeActionPerformed(ActionEvent evt) throws Exception { try { if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.getNewConnexionToDeep(""); } this.iNumeroPaginacionPagina=0; this.inicializarActualizarBindingProcesoPreciosPorcentaje(false,false); this.getProcesoPreciosPorcentajesFK_IdProducto(); this.inicializarActualizarBindingProcesoPreciosPorcentaje(false); //if(ProcesoPreciosPorcentajeBeanSwingJInternalFrame.ISBINDING_MANUAL) { //this.inicializarActualizarBindingProcesoPreciosPorcentaje(false,false); //} if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.commitNewConnexionToDeep(); } } catch(Exception e) { if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.rollbackNewConnexionToDeep(); } FuncionesSwing.manageException(this, e,logger,ProcesoPreciosPorcentajeConstantesFunciones.CLASSNAME); } finally { if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.closeNewConnexionToDeep(); } } } public void jButtonFK_IdSucursalProcesoPreciosPorcentajeActionPerformed(ActionEvent evt) throws Exception { try { if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.getNewConnexionToDeep(""); } this.iNumeroPaginacionPagina=0; this.inicializarActualizarBindingProcesoPreciosPorcentaje(false,false); this.getProcesoPreciosPorcentajesFK_IdSucursal(); this.inicializarActualizarBindingProcesoPreciosPorcentaje(false); //if(ProcesoPreciosPorcentajeBeanSwingJInternalFrame.ISBINDING_MANUAL) { //this.inicializarActualizarBindingProcesoPreciosPorcentaje(false,false); //} if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.commitNewConnexionToDeep(); } } catch(Exception e) { if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.rollbackNewConnexionToDeep(); } FuncionesSwing.manageException(this, e,logger,ProcesoPreciosPorcentajeConstantesFunciones.CLASSNAME); } finally { if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.closeNewConnexionToDeep(); } } } public void closingInternalFrameProcesoPreciosPorcentaje() { if(this.jInternalFrameDetalleFormProcesoPreciosPorcentaje!=null) { } if(this.jInternalFrameDetalleFormProcesoPreciosPorcentaje!=null) { this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.setVisible(false); this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.dispose(); this.jInternalFrameDetalleFormProcesoPreciosPorcentaje=null; } if(this.jInternalFrameReporteDinamicoProcesoPreciosPorcentaje!=null) { this.jInternalFrameReporteDinamicoProcesoPreciosPorcentaje.setVisible(false); this.jInternalFrameReporteDinamicoProcesoPreciosPorcentaje.dispose(); this.jInternalFrameReporteDinamicoProcesoPreciosPorcentaje=null; } if(this.jInternalFrameImportacionProcesoPreciosPorcentaje!=null) { this.jInternalFrameImportacionProcesoPreciosPorcentaje.setVisible(false); this.jInternalFrameImportacionProcesoPreciosPorcentaje.dispose(); this.jInternalFrameImportacionProcesoPreciosPorcentaje=null; } this.setVisible(false); this.dispose(); //this=null; } public void jButtonActionPerformedGeneral(String sTipo,ActionEvent evt) { try { this.startProcessProcesoPreciosPorcentaje(); ProcesoPreciosPorcentajeBeanSwingJInternalFrameAdditional.procesarEventosVista(this.parametroGeneralUsuario,this.moduloActual,this.opcionActual,this.usuarioActual,this,FuncionTipo.BEFORE,ControlTipo.BUTTON,EventoTipo.CLIC,EventoSubTipo.CLICKED,sTipo,this.procesopreciosporcentaje,new Object(),this.procesopreciosporcentajeParameterGeneral,this.procesopreciosporcentajeReturnGeneral); if(sTipo.equals("NuevoProcesoPreciosPorcentaje")) { jButtonNuevoProcesoPreciosPorcentajeActionPerformed(evt,false); } else if(sTipo.equals("DuplicarProcesoPreciosPorcentaje")) { jButtonDuplicarProcesoPreciosPorcentajeActionPerformed(evt,false); } else if(sTipo.equals("CopiarProcesoPreciosPorcentaje")) { jButtonCopiarProcesoPreciosPorcentajeActionPerformed(evt); } else if(sTipo.equals("VerFormProcesoPreciosPorcentaje")) { jButtonVerFormProcesoPreciosPorcentajeActionPerformed(evt); } else if(sTipo.equals("NuevoToolBarProcesoPreciosPorcentaje")) { jButtonNuevoProcesoPreciosPorcentajeActionPerformed(evt,false); } else if(sTipo.equals("DuplicarToolBarProcesoPreciosPorcentaje")) { jButtonDuplicarProcesoPreciosPorcentajeActionPerformed(evt,false); } else if(sTipo.equals("MenuItemNuevoProcesoPreciosPorcentaje")) { jButtonNuevoProcesoPreciosPorcentajeActionPerformed(evt,false); } else if(sTipo.equals("MenuItemDuplicarProcesoPreciosPorcentaje")) { jButtonDuplicarProcesoPreciosPorcentajeActionPerformed(evt,false); } else if(sTipo.equals("NuevoRelacionesProcesoPreciosPorcentaje")) { jButtonNuevoProcesoPreciosPorcentajeActionPerformed(evt,true); } else if(sTipo.equals("NuevoRelacionesToolBarProcesoPreciosPorcentaje")) { jButtonNuevoProcesoPreciosPorcentajeActionPerformed(evt,true); } else if(sTipo.equals("MenuItemNuevoRelacionesProcesoPreciosPorcentaje")) { jButtonNuevoProcesoPreciosPorcentajeActionPerformed(evt,true); } else if(sTipo.equals("ModificarProcesoPreciosPorcentaje")) { jButtonModificarProcesoPreciosPorcentajeActionPerformed(evt); } else if(sTipo.equals("ModificarToolBarProcesoPreciosPorcentaje")) { jButtonModificarProcesoPreciosPorcentajeActionPerformed(evt); } else if(sTipo.equals("MenuItemModificarProcesoPreciosPorcentaje")) { jButtonModificarProcesoPreciosPorcentajeActionPerformed(evt); } else if(sTipo.equals("ActualizarProcesoPreciosPorcentaje")) { jButtonActualizarProcesoPreciosPorcentajeActionPerformed(evt); } else if(sTipo.equals("ActualizarToolBarProcesoPreciosPorcentaje")) { jButtonActualizarProcesoPreciosPorcentajeActionPerformed(evt); } else if(sTipo.equals("MenuItemActualizarProcesoPreciosPorcentaje")) { jButtonActualizarProcesoPreciosPorcentajeActionPerformed(evt); } else if(sTipo.equals("EliminarProcesoPreciosPorcentaje")) { jButtonEliminarProcesoPreciosPorcentajeActionPerformed(evt); } else if(sTipo.equals("EliminarToolBarProcesoPreciosPorcentaje")) { jButtonEliminarProcesoPreciosPorcentajeActionPerformed(evt); } else if(sTipo.equals("MenuItemEliminarProcesoPreciosPorcentaje")) { jButtonEliminarProcesoPreciosPorcentajeActionPerformed(evt); } else if(sTipo.equals("CancelarProcesoPreciosPorcentaje")) { jButtonCancelarProcesoPreciosPorcentajeActionPerformed(evt); } else if(sTipo.equals("CancelarToolBarProcesoPreciosPorcentaje")) { jButtonCancelarProcesoPreciosPorcentajeActionPerformed(evt); } else if(sTipo.equals("MenuItemCancelarProcesoPreciosPorcentaje")) { jButtonCancelarProcesoPreciosPorcentajeActionPerformed(evt); } else if(sTipo.equals("CerrarProcesoPreciosPorcentaje")) { jButtonCerrarProcesoPreciosPorcentajeActionPerformed(evt); } else if(sTipo.equals("CerrarToolBarProcesoPreciosPorcentaje")) { jButtonCerrarProcesoPreciosPorcentajeActionPerformed(evt); } else if(sTipo.equals("MenuItemCerrarProcesoPreciosPorcentaje")) { jButtonCerrarProcesoPreciosPorcentajeActionPerformed(evt); } else if(sTipo.equals("MostrarOcultarToolBarProcesoPreciosPorcentaje")) { jButtonMostrarOcultarProcesoPreciosPorcentajeActionPerformed(evt); } else if(sTipo.equals("MenuItemDetalleCerrarProcesoPreciosPorcentaje")) { jButtonCancelarProcesoPreciosPorcentajeActionPerformed(evt); } else if(sTipo.equals("GuardarCambiosProcesoPreciosPorcentaje")) { jButtonGuardarCambiosProcesoPreciosPorcentajeActionPerformed(evt); } else if(sTipo.equals("GuardarCambiosToolBarProcesoPreciosPorcentaje")) { jButtonGuardarCambiosProcesoPreciosPorcentajeActionPerformed(evt); } else if(sTipo.equals("CopiarToolBarProcesoPreciosPorcentaje")) { jButtonCopiarProcesoPreciosPorcentajeActionPerformed(evt); } else if(sTipo.equals("VerFormToolBarProcesoPreciosPorcentaje")) { jButtonVerFormProcesoPreciosPorcentajeActionPerformed(evt); } else if(sTipo.equals("MenuItemGuardarCambiosProcesoPreciosPorcentaje")) { jButtonGuardarCambiosProcesoPreciosPorcentajeActionPerformed(evt); } else if(sTipo.equals("MenuItemCopiarProcesoPreciosPorcentaje")) { jButtonCopiarProcesoPreciosPorcentajeActionPerformed(evt); } else if(sTipo.equals("MenuItemVerFormProcesoPreciosPorcentaje")) { jButtonVerFormProcesoPreciosPorcentajeActionPerformed(evt); } else if(sTipo.equals("GuardarCambiosTablaProcesoPreciosPorcentaje")) { jButtonGuardarCambiosProcesoPreciosPorcentajeActionPerformed(evt); } else if(sTipo.equals("GuardarCambiosTablaToolBarProcesoPreciosPorcentaje")) { jButtonGuardarCambiosProcesoPreciosPorcentajeActionPerformed(evt); } else if(sTipo.equals("MenuItemGuardarCambiosTablaProcesoPreciosPorcentaje")) { jButtonGuardarCambiosProcesoPreciosPorcentajeActionPerformed(evt); } else if(sTipo.equals("RecargarInformacionProcesoPreciosPorcentaje")) { jButtonRecargarInformacionProcesoPreciosPorcentajeActionPerformed(evt); } else if(sTipo.equals("RecargarInformacionToolBarProcesoPreciosPorcentaje")) { jButtonRecargarInformacionProcesoPreciosPorcentajeActionPerformed(evt); } else if(sTipo.equals("MenuItemRecargarInformacionProcesoPreciosPorcentaje")) { jButtonRecargarInformacionProcesoPreciosPorcentajeActionPerformed(evt); } else if(sTipo.equals("AnterioresProcesoPreciosPorcentaje")) { jButtonAnterioresProcesoPreciosPorcentajeActionPerformed(evt); } else if(sTipo.equals("AnterioresToolBarProcesoPreciosPorcentaje")) { jButtonAnterioresProcesoPreciosPorcentajeActionPerformed(evt); } else if(sTipo.equals("MenuItemAnterioreProcesoPreciosPorcentaje")) { jButtonAnterioresProcesoPreciosPorcentajeActionPerformed(evt); } else if(sTipo.equals("SiguientesProcesoPreciosPorcentaje")) { jButtonSiguientesProcesoPreciosPorcentajeActionPerformed(evt); } else if(sTipo.equals("SiguientesToolBarProcesoPreciosPorcentaje")) { jButtonSiguientesProcesoPreciosPorcentajeActionPerformed(evt); } else if(sTipo.equals("MenuItemSiguientesProcesoPreciosPorcentaje")) { jButtonSiguientesProcesoPreciosPorcentajeActionPerformed(evt); } else if(sTipo.equals("MenuItemAbrirOrderByProcesoPreciosPorcentaje") || sTipo.equals("MenuItemDetalleAbrirOrderByProcesoPreciosPorcentaje")) { jButtonAbrirOrderByProcesoPreciosPorcentajeActionPerformed(evt); } else if(sTipo.equals("MenuItemMostrarOcultarProcesoPreciosPorcentaje") || sTipo.equals("MenuItemDetalleMostrarOcultarProcesoPreciosPorcentaje")) { jButtonMostrarOcultarProcesoPreciosPorcentajeActionPerformed(evt); } else if(sTipo.equals("NuevoGuardarCambiosProcesoPreciosPorcentaje")) { jButtonNuevoGuardarCambiosProcesoPreciosPorcentajeActionPerformed(evt); } else if(sTipo.equals("NuevoGuardarCambiosToolBarProcesoPreciosPorcentaje")) { jButtonNuevoGuardarCambiosProcesoPreciosPorcentajeActionPerformed(evt); } else if(sTipo.equals("MenuItemNuevoGuardarCambiosProcesoPreciosPorcentaje")) { jButtonNuevoGuardarCambiosProcesoPreciosPorcentajeActionPerformed(evt); } else if(sTipo.equals("CerrarReporteDinamicoProcesoPreciosPorcentaje")) { jButtonCerrarReporteDinamicoProcesoPreciosPorcentajeActionPerformed(evt); } else if(sTipo.equals("GenerarReporteDinamicoProcesoPreciosPorcentaje")) { jButtonGenerarReporteDinamicoProcesoPreciosPorcentajeActionPerformed(evt); } else if(sTipo.equals("GenerarExcelReporteDinamicoProcesoPreciosPorcentaje")) { jButtonGenerarExcelReporteDinamicoProcesoPreciosPorcentajeActionPerformed(evt); } else if(sTipo.equals("CerrarImportacionProcesoPreciosPorcentaje")) { jButtonCerrarImportacionProcesoPreciosPorcentajeActionPerformed(evt); } else if(sTipo.equals("GenerarImportacionProcesoPreciosPorcentaje")) { jButtonGenerarImportacionProcesoPreciosPorcentajeActionPerformed(evt); } else if(sTipo.equals("AbrirImportacionProcesoPreciosPorcentaje")) { jButtonAbrirImportacionProcesoPreciosPorcentajeActionPerformed(evt); } else if(sTipo.equals("TiposAccionesProcesoPreciosPorcentaje")) { jComboBoxTiposAccionesProcesoPreciosPorcentajeActionListener(evt,false); } else if(sTipo.equals("TiposRelacionesProcesoPreciosPorcentaje")) { jComboBoxTiposRelacionesProcesoPreciosPorcentajeActionListener(evt); } else if(sTipo.equals("TiposAccionesFormularioProcesoPreciosPorcentaje")) { jComboBoxTiposAccionesProcesoPreciosPorcentajeActionListener(evt,true); } else if(sTipo.equals("TiposSeleccionarProcesoPreciosPorcentaje")) { jComboBoxTiposSeleccionarProcesoPreciosPorcentajeActionListener(evt); } else if(sTipo.equals("ValorCampoGeneralProcesoPreciosPorcentaje")) { jTextFieldValorCampoGeneralProcesoPreciosPorcentajeActionListener(evt); } else if(sTipo.equals("AbrirOrderByProcesoPreciosPorcentaje")) { jButtonAbrirOrderByProcesoPreciosPorcentajeActionPerformed(evt); } else if(sTipo.equals("AbrirOrderByToolBarProcesoPreciosPorcentaje")) { jButtonAbrirOrderByProcesoPreciosPorcentajeActionPerformed(evt); } else if(sTipo.equals("CerrarOrderByProcesoPreciosPorcentaje")) { jButtonCerrarOrderByProcesoPreciosPorcentajeActionPerformed(evt); } //BUSQUEDA GENERAL CAMPO else if(sTipo.equals("idProcesoPreciosPorcentajeBusqueda")) { this.jButtonidProcesoPreciosPorcentajeBusquedaActionPerformed(evt); } //ACTUALIZAR CAMPO else if(sTipo.equals("id_bodegaProcesoPreciosPorcentajeUpdate")) { this.jButtonid_bodegaProcesoPreciosPorcentajeUpdateActionPerformed(evt); } //BUSQUEDA GENERAL CAMPO else if(sTipo.equals("id_bodegaProcesoPreciosPorcentajeBusqueda")) { this.jButtonid_bodegaProcesoPreciosPorcentajeBusquedaActionPerformed(evt); } //ACTUALIZAR CAMPO else if(sTipo.equals("id_productoProcesoPreciosPorcentajeUpdate")) { this.jButtonid_productoProcesoPreciosPorcentajeUpdateActionPerformed(evt); } //BUSQUEDA GENERAL CAMPO else if(sTipo.equals("id_productoProcesoPreciosPorcentajeBusqueda")) { this.jButtonid_productoProcesoPreciosPorcentajeBusquedaActionPerformed(evt); } //ACTUALIZAR CAMPO else if(sTipo.equals("id_empresaProcesoPreciosPorcentajeUpdate")) { this.jButtonid_empresaProcesoPreciosPorcentajeUpdateActionPerformed(evt); } //BUSQUEDA GENERAL CAMPO else if(sTipo.equals("id_empresaProcesoPreciosPorcentajeBusqueda")) { this.jButtonid_empresaProcesoPreciosPorcentajeBusquedaActionPerformed(evt); } //ACTUALIZAR CAMPO else if(sTipo.equals("id_sucursalProcesoPreciosPorcentajeUpdate")) { this.jButtonid_sucursalProcesoPreciosPorcentajeUpdateActionPerformed(evt); } //BUSQUEDA GENERAL CAMPO else if(sTipo.equals("id_sucursalProcesoPreciosPorcentajeBusqueda")) { this.jButtonid_sucursalProcesoPreciosPorcentajeBusquedaActionPerformed(evt); } //ACTUALIZAR CAMPO else if(sTipo.equals("id_lineaProcesoPreciosPorcentajeUpdate")) { this.jButtonid_lineaProcesoPreciosPorcentajeUpdateActionPerformed(evt); } //BUSQUEDA GENERAL CAMPO else if(sTipo.equals("id_lineaProcesoPreciosPorcentajeBusqueda")) { this.jButtonid_lineaProcesoPreciosPorcentajeBusquedaActionPerformed(evt); } //ACTUALIZAR CAMPO else if(sTipo.equals("id_linea_grupoProcesoPreciosPorcentajeUpdate")) { this.jButtonid_linea_grupoProcesoPreciosPorcentajeUpdateActionPerformed(evt); } //BUSQUEDA GENERAL CAMPO else if(sTipo.equals("id_linea_grupoProcesoPreciosPorcentajeBusqueda")) { this.jButtonid_linea_grupoProcesoPreciosPorcentajeBusquedaActionPerformed(evt); } //ACTUALIZAR CAMPO else if(sTipo.equals("id_linea_categoriaProcesoPreciosPorcentajeUpdate")) { this.jButtonid_linea_categoriaProcesoPreciosPorcentajeUpdateActionPerformed(evt); } //BUSQUEDA GENERAL CAMPO else if(sTipo.equals("id_linea_categoriaProcesoPreciosPorcentajeBusqueda")) { this.jButtonid_linea_categoriaProcesoPreciosPorcentajeBusquedaActionPerformed(evt); } //ACTUALIZAR CAMPO else if(sTipo.equals("id_linea_marcaProcesoPreciosPorcentajeUpdate")) { this.jButtonid_linea_marcaProcesoPreciosPorcentajeUpdateActionPerformed(evt); } //BUSQUEDA GENERAL CAMPO else if(sTipo.equals("id_linea_marcaProcesoPreciosPorcentajeBusqueda")) { this.jButtonid_linea_marcaProcesoPreciosPorcentajeBusquedaActionPerformed(evt); } //BUSQUEDA GENERAL CAMPO else if(sTipo.equals("codigoProcesoPreciosPorcentajeBusqueda")) { this.jButtoncodigoProcesoPreciosPorcentajeBusquedaActionPerformed(evt); } //BUSQUEDA GENERAL CAMPO else if(sTipo.equals("nombreProcesoPreciosPorcentajeBusqueda")) { this.jButtonnombreProcesoPreciosPorcentajeBusquedaActionPerformed(evt); } //BUSQUEDA GENERAL CAMPO else if(sTipo.equals("codigo_productoProcesoPreciosPorcentajeBusqueda")) { this.jButtoncodigo_productoProcesoPreciosPorcentajeBusquedaActionPerformed(evt); } //BUSQUEDA GENERAL CAMPO else if(sTipo.equals("nombre_productoProcesoPreciosPorcentajeBusqueda")) { this.jButtonnombre_productoProcesoPreciosPorcentajeBusquedaActionPerformed(evt); } //BUSQUEDA GENERAL CAMPO else if(sTipo.equals("precioProcesoPreciosPorcentajeBusqueda")) { this.jButtonprecioProcesoPreciosPorcentajeBusquedaActionPerformed(evt); } //BUSQUEDA GENERAL CAMPO else if(sTipo.equals("porcentajeProcesoPreciosPorcentajeBusqueda")) { this.jButtonporcentajeProcesoPreciosPorcentajeBusquedaActionPerformed(evt); } else if(sTipo.equals("BusquedaProcesoPreciosPorcentajeProcesoPreciosPorcentaje")) { this.jButtonBusquedaProcesoPreciosPorcentajeProcesoPreciosPorcentajeActionPerformed(evt); } ; ProcesoPreciosPorcentajeBeanSwingJInternalFrameAdditional.procesarEventosVista(this.parametroGeneralUsuario,this.moduloActual,this.opcionActual,this.usuarioActual,this,FuncionTipo.AFTER,ControlTipo.BUTTON,EventoTipo.CLIC,EventoSubTipo.CLICKED,sTipo,this.procesopreciosporcentaje,new Object(),this.procesopreciosporcentajeParameterGeneral,this.procesopreciosporcentajeReturnGeneral); } catch(Exception e) { FuncionesSwing.manageException2(this, e,logger,ProcesoPreciosPorcentajeConstantesFunciones.CLASSNAME); } finally { this.finishProcessProcesoPreciosPorcentaje(); } } //FUNCIONA AL APLASTAR ENTER public void jTextFieldActionPerformedGeneral(String sTipo,ActionEvent evt) { try { if(this.permiteManejarEventosControl()) { //SELECCIONA FILA A OBJETO ACTUAL this.seleccionarFilaTablaProcesoPreciosPorcentajeActual(); EventoGlobalTipo eventoGlobalTipo=EventoGlobalTipo.CONTROL_CHANGE; Boolean esControlTabla=false; Container containerParent=null; JTextField jTextField=null; //PARAMETROS LLAMAR FUNCION PARENT GeneralEntityParameterGeneral generalEntityParameterGeneral=new GeneralEntityParameterGeneral(); Boolean esUsoDesdeHijoLocal=false; Boolean conIrServidorAplicacionParent=false; ArrayList<String> arrClasses=new ArrayList<String>(); //PARAMETROS LLAMAR FUNCION PARENT_FIN /* if(this.esUsoDesdeHijo) { eventoGlobalTipo=EventoGlobalTipo.FORM_HIJO_ACTUALIZAR; } */ ArrayList<Classe> classes=new ArrayList<Classe>(); jTextField=(JTextField)evt.getSource(); containerParent=jTextField.getParent(); if(containerParent!=null && containerParent.getClass().equals(JTableMe.class)) { esControlTabla=true; } this.esControlTabla=esControlTabla; this.actualizarInformacion("EVENTO_CONTROL",false,this.procesopreciosporcentaje); this.actualizarInformacion("INFO_PADRE",false,this.procesopreciosporcentaje); ProcesoPreciosPorcentajeBeanSwingJInternalFrameAdditional.procesarEventosVista(this.parametroGeneralUsuario,this.moduloActual,this.opcionActual,this.usuarioActual,this,FuncionTipo.BEFORE,ControlTipo.TEXTBOX,EventoTipo.CHANGE,EventoSubTipo.CHANGED,sTipo,this.procesopreciosporcentaje,new Object(),this.procesopreciosporcentajeParameterGeneral,this.procesopreciosporcentajeReturnGeneral); ProcesoPreciosPorcentajeBeanSwingJInternalFrameAdditional.procesarEventosVista(this.parametroGeneralUsuario,this.moduloActual,this.opcionActual,this.usuarioActual,this,FuncionTipo.AFTER,ControlTipo.TEXTBOX,EventoTipo.CHANGE,EventoSubTipo.CHANGED,sTipo,this.procesopreciosporcentaje,new Object(),this.procesopreciosporcentajeParameterGeneral,this.procesopreciosporcentajeReturnGeneral); if(esUsoDesdeHijoLocal) { Long id=0L; generalEntityParameterGeneral.setEventoGlobalTipo(EventoGlobalTipo.FORM_HIJO_ACTUALIZAR); generalEntityParameterGeneral.setsDominio("Formulario"); generalEntityParameterGeneral.setsDominioTipo(ProcesoPreciosPorcentaje.class.getName()); if(this.jInternalFrameParent!=null) { this.jInternalFrameParent.setEventoParentGeneral(esUsoDesdeHijoLocal,"Formulario",ProcesoPreciosPorcentaje.class.getName(),sTipo,"TEXTFIELD",esControlTabla,conIrServidorAplicacionParent, id,jTextField, EventoGlobalTipo.FORM_HIJO_ACTUALIZAR,ControlTipo.TEXTBOX,EventoTipo.CHANGE,EventoSubTipo.CHANGED,arrClasses, evt,generalEntityParameterGeneral,null); } } } } catch(Exception e) { FuncionesSwing.manageException2(this, e,logger,ProcesoPreciosPorcentajeConstantesFunciones.CLASSNAME); } } public Boolean existeCambioValor(ControlTipo controlTipo,String sTipo) throws Exception { Boolean existeCambio=true; try { ProcesoPreciosPorcentaje procesopreciosporcentajeLocal=null; if(!this.getEsControlTabla()) { procesopreciosporcentajeLocal=this.procesopreciosporcentaje; } else { procesopreciosporcentajeLocal=this.procesopreciosporcentajeAnterior; } if(controlTipo.equals(ControlTipo.TEXTBOX)) { } } catch(Exception e) { FuncionesSwing.manageException2(this, e,logger,ProcesoPreciosPorcentajeConstantesFunciones.CLASSNAME); } return existeCambio; } public void jTextFieldFocusLostGeneral(String sTipo,java.awt.event.FocusEvent evt) { try { if(this.permiteManejarEventosControl() && this.existeCambioValor(ControlTipo.TEXTBOX,sTipo)) { EventoGlobalTipo eventoGlobalTipo=EventoGlobalTipo.CONTROL_CHANGE; Boolean esControlTabla=false; JTextField jTextField=null; Container containerParent=null; Component componentOpposite=null; //PARAMETROS LLAMAR FUNCION PARENT GeneralEntityParameterGeneral generalEntityParameterGeneral=new GeneralEntityParameterGeneral(); Boolean esUsoDesdeHijoLocal=false; Boolean conIrServidorAplicacionParent=false; ArrayList<String> arrClasses=new ArrayList<String>(); //PARAMETROS LLAMAR FUNCION PARENT_FIN /* if(this.esUsoDesdeHijo) { eventoGlobalTipo=EventoGlobalTipo.FORM_HIJO_ACTUALIZAR; } */ ArrayList<Classe> classes=new ArrayList<Classe>(); jTextField=(JTextField)evt.getSource(); containerParent=jTextField.getParent(); componentOpposite=evt.getOppositeComponent(); if((containerParent!=null && containerParent.getClass().equals(JTableMe.class)) || (componentOpposite!=null && componentOpposite.getClass().equals(JTableMe.class)) ) { esControlTabla=true; } this.esControlTabla=esControlTabla; this.actualizarInformacion("EVENTO_CONTROL",false,this.procesopreciosporcentaje); this.actualizarInformacion("INFO_PADRE",false,this.procesopreciosporcentaje); ProcesoPreciosPorcentajeBeanSwingJInternalFrameAdditional.procesarEventosVista(this.parametroGeneralUsuario,this.moduloActual,this.opcionActual,this.usuarioActual,this,FuncionTipo.BEFORE,ControlTipo.TEXTBOX,EventoTipo.CHANGE,EventoSubTipo.CHANGED,sTipo,this.procesopreciosporcentaje,new Object(),this.procesopreciosporcentajeParameterGeneral,this.procesopreciosporcentajeReturnGeneral); ProcesoPreciosPorcentajeBeanSwingJInternalFrameAdditional.procesarEventosVista(this.parametroGeneralUsuario,this.moduloActual,this.opcionActual,this.usuarioActual,this,FuncionTipo.AFTER,ControlTipo.TEXTBOX,EventoTipo.CHANGE,EventoSubTipo.CHANGED,sTipo,this.procesopreciosporcentaje,new Object(),this.procesopreciosporcentajeParameterGeneral,this.procesopreciosporcentajeReturnGeneral); if(esUsoDesdeHijoLocal) { Long id=0L; generalEntityParameterGeneral.setEventoGlobalTipo(EventoGlobalTipo.FORM_HIJO_ACTUALIZAR); generalEntityParameterGeneral.setsDominio("Formulario"); generalEntityParameterGeneral.setsDominioTipo(ProcesoPreciosPorcentaje.class.getName()); if(this.jInternalFrameParent!=null) { this.jInternalFrameParent.setEventoParentGeneral(esUsoDesdeHijoLocal,"Formulario",ProcesoPreciosPorcentaje.class.getName(),sTipo,"TEXTFIELD",esControlTabla,conIrServidorAplicacionParent, id,jTextField, EventoGlobalTipo.FORM_HIJO_ACTUALIZAR,ControlTipo.TEXTBOX,EventoTipo.CHANGE,EventoSubTipo.CHANGED,arrClasses, evt,generalEntityParameterGeneral,null); } } } } catch(Exception e) { FuncionesSwing.manageException2(this, e,logger,ProcesoPreciosPorcentajeConstantesFunciones.CLASSNAME); } } public void jTextFieldFocusGainedGeneral(String sTipo,java.awt.event.FocusEvent evt) { try { //SELECCIONA FILA A OBJETO ACTUAL this.seleccionarFilaTablaProcesoPreciosPorcentajeActual(); //SELECCIONA FILA A OBJETO ANTERIOR Integer intSelectedRow = this.jTableDatosProcesoPreciosPorcentaje.getSelectedRow(); if(intSelectedRow!=null && intSelectedRow>-1) { //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeAnterior =(ProcesoPreciosPorcentaje) this.procesopreciosporcentajeLogic.getProcesoPreciosPorcentajes().toArray()[this.jTableDatosProcesoPreciosPorcentaje.convertRowIndexToModel(intSelectedRow)]; } else if(Constantes.ISUSAEJBREMOTE || Constantes.ISUSAEJBHOME ) { this.procesopreciosporcentajeAnterior =(ProcesoPreciosPorcentaje) this.procesopreciosporcentajes.toArray()[this.jTableDatosProcesoPreciosPorcentaje.convertRowIndexToModel(intSelectedRow)]; } //ARCHITECTURE //System.out.println(this.banco); } } catch(Exception e) { FuncionesSwing.manageException2(this, e,logger,ProcesoPreciosPorcentajeConstantesFunciones.CLASSNAME); } } //CUANDO SE CAMBIA ALGUN FORMATO(TIPO DE LETRA,NEGRILLA,ETC) public void jTextFieldChangedUpdateGeneral(String sTipo,JTextField jTextField,DocumentEvent evt) { try { /* EventoGlobalTipo eventoGlobalTipo=EventoGlobalTipo.CONTROL_CHANGE; //System.out.println("UPDATE"); Boolean esControlTabla=false; //JTextField jTextField=null; Container containerParent=null; Component componentOpposite=null; if(this.esUsoDesdeHijo) { eventoGlobalTipo=EventoGlobalTipo.FORM_HIJO_ACTUALIZAR; } ProcesoPreciosPorcentajeBeanSwingJInternalFrameAdditional.procesarEventosVista(this.parametroGeneralUsuario,this.moduloActual,this.opcionActual,this.usuarioActual,this,FuncionTipo.BEFORE,ControlTipo.TEXTBOX,EventoTipo.CHANGE,EventoSubTipo.CHANGED,sTipo,this.procesopreciosporcentaje,new Object(),this.procesopreciosporcentajeParameterGeneral,this.procesopreciosporcentajeReturnGeneral); ArrayList<Classe> classes=new ArrayList<Classe>(); //jTextField=(JTextField)evt.getSource(); containerParent=jTextField.getParent(); componentOpposite=null;//evt.getOppositeComponent(); if((containerParent!=null && containerParent.getClass().equals(JTableMe.class)) || (componentOpposite!=null && componentOpposite.getClass().equals(JTableMe.class)) ) { esControlTabla=true; } this.esControlTabla=esControlTabla; ProcesoPreciosPorcentajeBeanSwingJInternalFrameAdditional.procesarEventosVista(this.parametroGeneralUsuario,this.moduloActual,this.opcionActual,this.usuarioActual,this,FuncionTipo.AFTER,ControlTipo.TEXTBOX,EventoTipo.CHANGE,EventoSubTipo.CHANGED,sTipo,this.procesopreciosporcentaje,new Object(),this.procesopreciosporcentajeParameterGeneral,this.procesopreciosporcentajeReturnGeneral); */ } catch(Exception e) { FuncionesSwing.manageException2(this, e,logger,ProcesoPreciosPorcentajeConstantesFunciones.CLASSNAME); } } //CUANDO SE QUITA ALGUN CARACTER public void jTextFieldRemoveUpdateGeneral(String sTipo,JTextField jTextField,DocumentEvent evt) { try { //System.out.println("REMOVE"); } catch(Exception e) { FuncionesSwing.manageException2(this, e,logger,ProcesoPreciosPorcentajeConstantesFunciones.CLASSNAME); } } //CUANDO SE INGRESA ALGUN CARACTER public void jTextFieldInsertUpdateGeneral(String sTipo,JTextField jTextField,DocumentEvent evt) { try { //System.out.println("INSERT"); } catch(Exception e) { FuncionesSwing.manageException2(this, e,logger,ProcesoPreciosPorcentajeConstantesFunciones.CLASSNAME); } } //FUNCIONA AL APLASTAR ENTER public void jFormattedTextFieldActionPerformedGeneral(String sTipo,ActionEvent evt) { try { if(this.permiteManejarEventosControl()) { //SELECCIONA FILA A OBJETO ACTUAL this.seleccionarFilaTablaProcesoPreciosPorcentajeActual(); EventoGlobalTipo eventoGlobalTipo=EventoGlobalTipo.CONTROL_CHANGE; Boolean esControlTabla=false; Container containerParent=null; Container containerParentAux=null; JFormattedTextField JFormattedTextField=null; Component componentOpposite=null; //PARAMETROS LLAMAR FUNCION PARENT GeneralEntityParameterGeneral generalEntityParameterGeneral=new GeneralEntityParameterGeneral(); Boolean esUsoDesdeHijoLocal=false; Boolean conIrServidorAplicacionParent=false; ArrayList<String> arrClasses=new ArrayList<String>(); //PARAMETROS LLAMAR FUNCION PARENT_FIN /* if(this.esUsoDesdeHijo) { eventoGlobalTipo=EventoGlobalTipo.FORM_HIJO_ACTUALIZAR; } */ ArrayList<Classe> classes=new ArrayList<Classe>(); JFormattedTextField=(JFormattedTextField)evt.getSource(); containerParentAux=JFormattedTextField.getParent(); if(containerParentAux!=null && containerParentAux.getClass().equals(JDateChooser.class)) { containerParent=containerParentAux.getParent(); } componentOpposite=null;//evt.getOppositeComponent(); if((containerParent!=null && containerParent.getClass().equals(JTableMe.class)) || (componentOpposite!=null && componentOpposite.getClass().equals(JTableMe.class)) ) { esControlTabla=true; } this.esControlTabla=esControlTabla; this.actualizarInformacion("EVENTO_CONTROL",false,this.procesopreciosporcentaje); this.actualizarInformacion("INFO_PADRE",false,this.procesopreciosporcentaje); ProcesoPreciosPorcentajeBeanSwingJInternalFrameAdditional.procesarEventosVista(this.parametroGeneralUsuario,this.moduloActual,this.opcionActual,this.usuarioActual,this,FuncionTipo.BEFORE,ControlTipo.DATE,EventoTipo.CHANGE,EventoSubTipo.CHANGED,sTipo,this.procesopreciosporcentaje,new Object(),this.procesopreciosporcentajeParameterGeneral,this.procesopreciosporcentajeReturnGeneral); ProcesoPreciosPorcentajeBeanSwingJInternalFrameAdditional.procesarEventosVista(this.parametroGeneralUsuario,this.moduloActual,this.opcionActual,this.usuarioActual,this,FuncionTipo.AFTER,ControlTipo.DATE,EventoTipo.CHANGE,EventoSubTipo.CHANGED,sTipo,this.procesopreciosporcentaje,new Object(),this.procesopreciosporcentajeParameterGeneral,this.procesopreciosporcentajeReturnGeneral); if(esUsoDesdeHijoLocal) { Long id=0L; generalEntityParameterGeneral.setEventoGlobalTipo(EventoGlobalTipo.FORM_HIJO_ACTUALIZAR); generalEntityParameterGeneral.setsDominio("Formulario"); generalEntityParameterGeneral.setsDominioTipo(ProcesoPreciosPorcentaje.class.getName()); if(this.jInternalFrameParent!=null) { this.jInternalFrameParent.setEventoParentGeneral(esUsoDesdeHijoLocal,"Formulario",ProcesoPreciosPorcentaje.class.getName(),sTipo,"DATE",esControlTabla,conIrServidorAplicacionParent, id,JFormattedTextField, EventoGlobalTipo.FORM_HIJO_ACTUALIZAR,ControlTipo.DATE,EventoTipo.CHANGE,EventoSubTipo.CHANGED,arrClasses, evt,generalEntityParameterGeneral,null); } } } } catch(Exception e) { FuncionesSwing.manageException2(this, e,logger,ProcesoPreciosPorcentajeConstantesFunciones.CLASSNAME); } } public void jFormattedTextFieldFocusLostGeneral(String sTipo,java.awt.event.FocusEvent evt) { try { if(this.permiteManejarEventosControl() && this.existeCambioValor(ControlTipo.TEXTBOX,sTipo)) { EventoGlobalTipo eventoGlobalTipo=EventoGlobalTipo.CONTROL_CHANGE; Boolean esControlTabla=false; JTextField jTextField=null; Container containerParent=null; Container containerParentAux=null; Component componentOpposite=null; //PARAMETROS LLAMAR FUNCION PARENT GeneralEntityParameterGeneral generalEntityParameterGeneral=new GeneralEntityParameterGeneral(); Boolean esUsoDesdeHijoLocal=false; Boolean conIrServidorAplicacionParent=false; ArrayList<String> arrClasses=new ArrayList<String>(); //PARAMETROS LLAMAR FUNCION PARENT_FIN /* if(this.esUsoDesdeHijo) { eventoGlobalTipo=EventoGlobalTipo.FORM_HIJO_ACTUALIZAR; } */ ArrayList<Classe> classes=new ArrayList<Classe>(); jTextField=(JTextField)evt.getSource(); containerParentAux=jTextField.getParent(); if(containerParentAux!=null && containerParentAux.getClass().equals(JDateChooser.class)) { containerParent=containerParentAux.getParent(); } componentOpposite=evt.getOppositeComponent(); if((containerParent!=null && containerParent.getClass().equals(JTableMe.class)) || (componentOpposite!=null && componentOpposite.getClass().equals(JTableMe.class)) ) { esControlTabla=true; } this.esControlTabla=esControlTabla; this.actualizarInformacion("EVENTO_CONTROL",false,this.procesopreciosporcentaje); this.actualizarInformacion("INFO_PADRE",false,this.procesopreciosporcentaje); ProcesoPreciosPorcentajeBeanSwingJInternalFrameAdditional.procesarEventosVista(this.parametroGeneralUsuario,this.moduloActual,this.opcionActual,this.usuarioActual,this,FuncionTipo.BEFORE,ControlTipo.DATE,EventoTipo.CHANGE,EventoSubTipo.CHANGED,sTipo,this.procesopreciosporcentaje,new Object(),this.procesopreciosporcentajeParameterGeneral,this.procesopreciosporcentajeReturnGeneral); ProcesoPreciosPorcentajeBeanSwingJInternalFrameAdditional.procesarEventosVista(this.parametroGeneralUsuario,this.moduloActual,this.opcionActual,this.usuarioActual,this,FuncionTipo.AFTER,ControlTipo.DATE,EventoTipo.CHANGE,EventoSubTipo.CHANGED,sTipo,this.procesopreciosporcentaje,new Object(),this.procesopreciosporcentajeParameterGeneral,this.procesopreciosporcentajeReturnGeneral); if(esUsoDesdeHijoLocal) { Long id=0L; generalEntityParameterGeneral.setEventoGlobalTipo(EventoGlobalTipo.FORM_HIJO_ACTUALIZAR); generalEntityParameterGeneral.setsDominio("Formulario"); generalEntityParameterGeneral.setsDominioTipo(ProcesoPreciosPorcentaje.class.getName()); if(this.jInternalFrameParent!=null) { this.jInternalFrameParent.setEventoParentGeneral(esUsoDesdeHijoLocal,"Formulario",ProcesoPreciosPorcentaje.class.getName(),sTipo,"TEXTFIELD",esControlTabla,conIrServidorAplicacionParent, id,jTextField, EventoGlobalTipo.FORM_HIJO_ACTUALIZAR,ControlTipo.TEXTBOX,EventoTipo.CHANGE,EventoSubTipo.CHANGED,arrClasses, evt,generalEntityParameterGeneral,null); } } } } catch(Exception e) { FuncionesSwing.manageException2(this, e,logger,ProcesoPreciosPorcentajeConstantesFunciones.CLASSNAME); } } public void jFormattedTextFieldFocusGainedGeneral(String sTipo,java.awt.event.FocusEvent evt) { try { //SELECCIONA FILA A OBJETO ACTUAL this.seleccionarFilaTablaProcesoPreciosPorcentajeActual(); //SELECCIONA FILA A OBJETO ANTERIOR Integer intSelectedRow = this.jTableDatosProcesoPreciosPorcentaje.getSelectedRow(); if(intSelectedRow!=null && intSelectedRow>-1) { //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeAnterior =(ProcesoPreciosPorcentaje) this.procesopreciosporcentajeLogic.getProcesoPreciosPorcentajes().toArray()[this.jTableDatosProcesoPreciosPorcentaje.convertRowIndexToModel(intSelectedRow)]; } else if(Constantes.ISUSAEJBREMOTE || Constantes.ISUSAEJBHOME ) { this.procesopreciosporcentajeAnterior =(ProcesoPreciosPorcentaje) this.procesopreciosporcentajes.toArray()[this.jTableDatosProcesoPreciosPorcentaje.convertRowIndexToModel(intSelectedRow)]; } //ARCHITECTURE //System.out.println(this.banco); } } catch(Exception e) { FuncionesSwing.manageException2(this, e,logger,ProcesoPreciosPorcentajeConstantesFunciones.CLASSNAME); } } public void jDateChooserFocusLostGeneral(String sTipo,java.awt.event.FocusEvent evt) { try { if(this.permiteManejarEventosControl() && this.existeCambioValor(ControlTipo.DATE,sTipo)) { this.actualizarInformacion("EVENTO_CONTROL",false,this.procesopreciosporcentaje); this.actualizarInformacion("INFO_PADRE",false,this.procesopreciosporcentaje); } } catch(Exception e) { FuncionesSwing.manageException2(this, e,logger,ProcesoPreciosPorcentajeConstantesFunciones.CLASSNAME); } } public void jDateChooserFocusGainedGeneral(String sTipo,java.awt.event.FocusEvent evt) { try { //SELECCIONA FILA A OBJETO ACTUAL this.seleccionarFilaTablaProcesoPreciosPorcentajeActual(); //SELECCIONA FILA A OBJETO ANTERIOR Integer intSelectedRow = this.jTableDatosProcesoPreciosPorcentaje.getSelectedRow(); if(intSelectedRow!=null && intSelectedRow>-1) { //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeAnterior =(ProcesoPreciosPorcentaje) this.procesopreciosporcentajeLogic.getProcesoPreciosPorcentajes().toArray()[this.jTableDatosProcesoPreciosPorcentaje.convertRowIndexToModel(intSelectedRow)]; } else if(Constantes.ISUSAEJBREMOTE || Constantes.ISUSAEJBHOME ) { this.procesopreciosporcentajeAnterior =(ProcesoPreciosPorcentaje) this.procesopreciosporcentajes.toArray()[this.jTableDatosProcesoPreciosPorcentaje.convertRowIndexToModel(intSelectedRow)]; } //ARCHITECTURE //System.out.println(this.banco); } } catch(Exception e) { FuncionesSwing.manageException2(this, e,logger,ProcesoPreciosPorcentajeConstantesFunciones.CLASSNAME); } } public void jDateChooserActionPerformedGeneral(String sTipo,ActionEvent evt) { try { //SELECCIONA FILA A OBJETO ACTUAL this.seleccionarFilaTablaProcesoPreciosPorcentajeActual(); this.actualizarInformacion("EVENTO_CONTROL",false,this.procesopreciosporcentaje); this.actualizarInformacion("INFO_PADRE",false,this.procesopreciosporcentaje); } catch(Exception e) { FuncionesSwing.manageException2(this, e,logger,ProcesoPreciosPorcentajeConstantesFunciones.CLASSNAME); } } public void jTextAreaFocusLostGeneral(String sTipo,java.awt.event.FocusEvent evt) { try { if(this.permiteManejarEventosControl() && this.existeCambioValor(ControlTipo.TEXTAREA,sTipo)) { EventoGlobalTipo eventoGlobalTipo=EventoGlobalTipo.CONTROL_CHANGE; Boolean esControlTabla=false; JTextArea jTextArea=null; Container containerParent=null; Component componentOpposite=null; //PARAMETROS LLAMAR FUNCION PARENT GeneralEntityParameterGeneral generalEntityParameterGeneral=new GeneralEntityParameterGeneral(); Boolean esUsoDesdeHijoLocal=false; Boolean conIrServidorAplicacionParent=false; ArrayList<String> arrClasses=new ArrayList<String>(); //PARAMETROS LLAMAR FUNCION PARENT_FIN /* if(this.esUsoDesdeHijo) { eventoGlobalTipo=EventoGlobalTipo.FORM_HIJO_ACTUALIZAR; } */ ArrayList<Classe> classes=new ArrayList<Classe>(); jTextArea=(JTextArea)evt.getSource(); containerParent=jTextArea.getParent(); componentOpposite=evt.getOppositeComponent(); if((containerParent!=null && containerParent.getClass().equals(JTableMe.class)) || (componentOpposite!=null && componentOpposite.getClass().equals(JTableMe.class)) ) { esControlTabla=true; } this.esControlTabla=esControlTabla; this.actualizarInformacion("EVENTO_CONTROL",false,this.procesopreciosporcentaje); this.actualizarInformacion("INFO_PADRE",false,this.procesopreciosporcentaje); ProcesoPreciosPorcentajeBeanSwingJInternalFrameAdditional.procesarEventosVista(this.parametroGeneralUsuario,this.moduloActual,this.opcionActual,this.usuarioActual,this,FuncionTipo.BEFORE,ControlTipo.TEXTAREA,EventoTipo.CHANGE,EventoSubTipo.CHANGED,sTipo,this.procesopreciosporcentaje,new Object(),this.procesopreciosporcentajeParameterGeneral,this.procesopreciosporcentajeReturnGeneral); ProcesoPreciosPorcentajeBeanSwingJInternalFrameAdditional.procesarEventosVista(this.parametroGeneralUsuario,this.moduloActual,this.opcionActual,this.usuarioActual,this,FuncionTipo.AFTER,ControlTipo.TEXTAREA,EventoTipo.CHANGE,EventoSubTipo.CHANGED,sTipo,this.procesopreciosporcentaje,new Object(),this.procesopreciosporcentajeParameterGeneral,this.procesopreciosporcentajeReturnGeneral); if(esUsoDesdeHijoLocal) { Long id=0L; generalEntityParameterGeneral.setEventoGlobalTipo(EventoGlobalTipo.FORM_HIJO_ACTUALIZAR); generalEntityParameterGeneral.setsDominio("Formulario"); generalEntityParameterGeneral.setsDominioTipo(ProcesoPreciosPorcentaje.class.getName()); if(this.jInternalFrameParent!=null) { this.jInternalFrameParent.setEventoParentGeneral(esUsoDesdeHijoLocal,"Formulario",ProcesoPreciosPorcentaje.class.getName(),sTipo,"TEXTAREA",esControlTabla,conIrServidorAplicacionParent, id,jTextArea, EventoGlobalTipo.FORM_HIJO_ACTUALIZAR,ControlTipo.TEXTAREA,EventoTipo.CHANGE,EventoSubTipo.CHANGED,arrClasses, evt,generalEntityParameterGeneral,null); } } } } catch(Exception e) { FuncionesSwing.manageException2(this, e,logger,ProcesoPreciosPorcentajeConstantesFunciones.CLASSNAME); } } public void jTextAreaFocusGainedGeneral(String sTipo,java.awt.event.FocusEvent evt) { try { if(this.permiteManejarEventosControl()) { //SELECCIONA FILA A OBJETO ACTUAL this.seleccionarFilaTablaProcesoPreciosPorcentajeActual(); //SELECCIONA FILA A OBJETO ANTERIOR Integer intSelectedRow = this.jTableDatosProcesoPreciosPorcentaje.getSelectedRow(); if(intSelectedRow!=null && intSelectedRow>-1) { //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeAnterior =(ProcesoPreciosPorcentaje) this.procesopreciosporcentajeLogic.getProcesoPreciosPorcentajes().toArray()[this.jTableDatosProcesoPreciosPorcentaje.convertRowIndexToModel(intSelectedRow)]; } else if(Constantes.ISUSAEJBREMOTE || Constantes.ISUSAEJBHOME ) { this.procesopreciosporcentajeAnterior =(ProcesoPreciosPorcentaje) this.procesopreciosporcentajes.toArray()[this.jTableDatosProcesoPreciosPorcentaje.convertRowIndexToModel(intSelectedRow)]; } //ARCHITECTURE //System.out.println(this.banco); } } } catch(Exception e) { FuncionesSwing.manageException2(this, e,logger,ProcesoPreciosPorcentajeConstantesFunciones.CLASSNAME); } } public void jTextAreaChangedUpdateGeneral(String sTipo,JTextArea jTextArea,DocumentEvent evt) { try { /* EventoGlobalTipo eventoGlobalTipo=EventoGlobalTipo.CONTROL_CHANGE; //System.out.println("UPDATE"); Boolean esControlTabla=false; //JTextArea jTextArea=null; Container containerParent=null; Component componentOpposite=null; if(this.esUsoDesdeHijo) { eventoGlobalTipo=EventoGlobalTipo.FORM_HIJO_ACTUALIZAR; } ProcesoPreciosPorcentajeBeanSwingJInternalFrameAdditional.procesarEventosVista(this.parametroGeneralUsuario,this.moduloActual,this.opcionActual,this.usuarioActual,this,FuncionTipo.BEFORE,ControlTipo.TEXTAREA,EventoTipo.CHANGE,EventoSubTipo.CHANGED,sTipo,this.procesopreciosporcentaje,new Object(),this.procesopreciosporcentajeParameterGeneral,this.procesopreciosporcentajeReturnGeneral); ArrayList<Classe> classes=new ArrayList<Classe>(); //jTextArea=(JTextArea)evt.getSource(); containerParent=jTextArea.getParent(); componentOpposite=null;//evt.getOppositeComponent(); if((containerParent!=null && containerParent.getClass().equals(JTableMe.class)) || (componentOpposite!=null && componentOpposite.getClass().equals(JTableMe.class)) ) { esControlTabla=true; } this.esControlTabla=esControlTabla; ProcesoPreciosPorcentajeBeanSwingJInternalFrameAdditional.procesarEventosVista(this.parametroGeneralUsuario,this.moduloActual,this.opcionActual,this.usuarioActual,this,FuncionTipo.AFTER,ControlTipo.TEXTAREA,EventoTipo.CHANGE,EventoSubTipo.CHANGED,sTipo,this.procesopreciosporcentaje,new Object(),this.procesopreciosporcentajeParameterGeneral,this.procesopreciosporcentajeReturnGeneral); */ } catch(Exception e) { FuncionesSwing.manageException2(this, e,logger,ProcesoPreciosPorcentajeConstantesFunciones.CLASSNAME); } } public void jTextAreaRemoveUpdateGeneral(String sTipo,JTextArea jTextArea,DocumentEvent evt) { try { //System.out.println("REMOVE"); } catch(Exception e) { FuncionesSwing.manageException2(this, e,logger,ProcesoPreciosPorcentajeConstantesFunciones.CLASSNAME); } } public void jTextAreaInsertUpdateGeneral(String sTipo,JTextArea jTextArea,DocumentEvent evt) { try { //System.out.println("INSERT"); } catch(Exception e) { FuncionesSwing.manageException2(this, e,logger,ProcesoPreciosPorcentajeConstantesFunciones.CLASSNAME); } } //NO EXISTE O NO ES APLICABLE public void jTextAreaActionPerformedGeneral(String sTipo,ActionEvent evt) { try { //SELECCIONA FILA A OBJETO ACTUAL this.seleccionarFilaTablaProcesoPreciosPorcentajeActual(); this.actualizarInformacion("EVENTO_CONTROL",false,this.procesopreciosporcentaje); this.actualizarInformacion("INFO_PADRE",false,this.procesopreciosporcentaje); } catch(Exception e) { FuncionesSwing.manageException2(this, e,logger,ProcesoPreciosPorcentajeConstantesFunciones.CLASSNAME); } } public void jLabelFocusLostGeneral(String sTipo,java.awt.event.FocusEvent evt) { try { if(this.permiteManejarEventosControl()) { EventoGlobalTipo eventoGlobalTipo=EventoGlobalTipo.CONTROL_CHANGE; Boolean esControlTabla=false; JLabel jLabel=null; Container containerParent=null; Component componentOpposite=null; //PARAMETROS LLAMAR FUNCION PARENT GeneralEntityParameterGeneral generalEntityParameterGeneral=new GeneralEntityParameterGeneral(); Boolean esUsoDesdeHijoLocal=false; Boolean conIrServidorAplicacionParent=false; ArrayList<String> arrClasses=new ArrayList<String>(); //PARAMETROS LLAMAR FUNCION PARENT_FIN /* if(this.esUsoDesdeHijo) { eventoGlobalTipo=EventoGlobalTipo.FORM_HIJO_ACTUALIZAR; } */ ArrayList<Classe> classes=new ArrayList<Classe>(); jLabel=(JLabel)evt.getSource(); containerParent=jLabel.getParent(); componentOpposite=evt.getOppositeComponent(); if((containerParent!=null && containerParent.getClass().equals(JTableMe.class)) || (componentOpposite!=null && componentOpposite.getClass().equals(JTableMe.class)) ) { esControlTabla=true; } this.esControlTabla=esControlTabla; this.actualizarInformacion("EVENTO_CONTROL",false,this.procesopreciosporcentaje); this.actualizarInformacion("INFO_PADRE",false,this.procesopreciosporcentaje); ProcesoPreciosPorcentajeBeanSwingJInternalFrameAdditional.procesarEventosVista(this.parametroGeneralUsuario,this.moduloActual,this.opcionActual,this.usuarioActual,this,FuncionTipo.BEFORE,ControlTipo.TEXTBOX,EventoTipo.CHANGE,EventoSubTipo.CHANGED,sTipo,this.procesopreciosporcentaje,new Object(),this.procesopreciosporcentajeParameterGeneral,this.procesopreciosporcentajeReturnGeneral); ProcesoPreciosPorcentajeBeanSwingJInternalFrameAdditional.procesarEventosVista(this.parametroGeneralUsuario,this.moduloActual,this.opcionActual,this.usuarioActual,this,FuncionTipo.AFTER,ControlTipo.TEXTBOX,EventoTipo.CHANGE,EventoSubTipo.CHANGED,sTipo,this.procesopreciosporcentaje,new Object(),this.procesopreciosporcentajeParameterGeneral,this.procesopreciosporcentajeReturnGeneral); if(esUsoDesdeHijoLocal) { Long id=0L; generalEntityParameterGeneral.setEventoGlobalTipo(EventoGlobalTipo.FORM_HIJO_ACTUALIZAR); generalEntityParameterGeneral.setsDominio("Formulario"); generalEntityParameterGeneral.setsDominioTipo(ProcesoPreciosPorcentaje.class.getName()); if(this.jInternalFrameParent!=null) { this.jInternalFrameParent.setEventoParentGeneral(esUsoDesdeHijoLocal,"Formulario",ProcesoPreciosPorcentaje.class.getName(),sTipo,"TEXTFIELD",esControlTabla,conIrServidorAplicacionParent, id,jLabel, EventoGlobalTipo.FORM_HIJO_ACTUALIZAR,ControlTipo.TEXTBOX,EventoTipo.CHANGE,EventoSubTipo.CHANGED,arrClasses, evt,generalEntityParameterGeneral,null); } } } } catch(Exception e) { FuncionesSwing.manageException2(this, e,logger,ProcesoPreciosPorcentajeConstantesFunciones.CLASSNAME); } } public void jLabelFocusGainedGeneral(String sTipo,java.awt.event.FocusEvent evt) { try { //SELECCIONA FILA A OBJETO ACTUAL this.seleccionarFilaTablaProcesoPreciosPorcentajeActual(); //SELECCIONA FILA A OBJETO ANTERIOR Integer intSelectedRow = this.jTableDatosProcesoPreciosPorcentaje.getSelectedRow(); if(intSelectedRow!=null && intSelectedRow>-1) { //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeAnterior =(ProcesoPreciosPorcentaje) this.procesopreciosporcentajeLogic.getProcesoPreciosPorcentajes().toArray()[this.jTableDatosProcesoPreciosPorcentaje.convertRowIndexToModel(intSelectedRow)]; } else if(Constantes.ISUSAEJBREMOTE || Constantes.ISUSAEJBHOME ) { this.procesopreciosporcentajeAnterior =(ProcesoPreciosPorcentaje) this.procesopreciosporcentajes.toArray()[this.jTableDatosProcesoPreciosPorcentaje.convertRowIndexToModel(intSelectedRow)]; } //ARCHITECTURE //System.out.println(this.banco); } } catch(Exception e) { FuncionesSwing.manageException2(this, e,logger,ProcesoPreciosPorcentajeConstantesFunciones.CLASSNAME); } } //NO EXISTE O NO ES APLICABLE public void jLabelActionPerformedGeneral(String sTipo,ActionEvent evt) { try { //SELECCIONA FILA A OBJETO ACTUAL this.seleccionarFilaTablaProcesoPreciosPorcentajeActual(); this.actualizarInformacion("EVENTO_CONTROL",false,this.procesopreciosporcentaje); this.actualizarInformacion("INFO_PADRE",false,this.procesopreciosporcentaje); } catch(Exception e) { FuncionesSwing.manageException2(this, e,logger,ProcesoPreciosPorcentajeConstantesFunciones.CLASSNAME); } } public void jCheckBoxItemListenerGeneral(String sTipo,ItemEvent evt) { try { if(this.permiteManejarEventosControl()) { //SELECCIONA FILA A OBJETO ACTUAL this.seleccionarFilaTablaProcesoPreciosPorcentajeActual(); EventoGlobalTipo eventoGlobalTipo=EventoGlobalTipo.CONTROL_CHANGE; Boolean esControlTabla=false; JCheckBox jCheckBox=null; Container containerParent=null; Component componentOpposite=null; //PARAMETROS LLAMAR FUNCION PARENT GeneralEntityParameterGeneral generalEntityParameterGeneral=new GeneralEntityParameterGeneral(); Boolean esUsoDesdeHijoLocal=false; Boolean conIrServidorAplicacionParent=false; ArrayList<String> arrClasses=new ArrayList<String>(); //PARAMETROS LLAMAR FUNCION PARENT_FIN /* if(this.esUsoDesdeHijo) { eventoGlobalTipo=EventoGlobalTipo.FORM_HIJO_ACTUALIZAR; } */ ArrayList<Classe> classes=new ArrayList<Classe>(); jCheckBox=(JCheckBox)evt.getSource(); containerParent=jCheckBox.getParent(); componentOpposite=null;//evt.getOppositeComponent(); if((containerParent!=null && containerParent.getClass().equals(JTableMe.class)) || (componentOpposite!=null && componentOpposite.getClass().equals(JTableMe.class)) ) { esControlTabla=true; } this.esControlTabla=esControlTabla; this.actualizarInformacion("EVENTO_CONTROL",false,this.procesopreciosporcentaje); this.actualizarInformacion("INFO_PADRE",false,this.procesopreciosporcentaje); ProcesoPreciosPorcentajeBeanSwingJInternalFrameAdditional.procesarEventosVista(this.parametroGeneralUsuario,this.moduloActual,this.opcionActual,this.usuarioActual,this,FuncionTipo.BEFORE,ControlTipo.CHECKBOX,EventoTipo.CLIC,EventoSubTipo.CLICKED,sTipo,this.procesopreciosporcentaje,new Object(),this.procesopreciosporcentajeParameterGeneral,this.procesopreciosporcentajeReturnGeneral); if(sTipo.equals("SeleccionarTodosProcesoPreciosPorcentaje")) { jCheckBoxSeleccionarTodosProcesoPreciosPorcentajeItemListener(evt); } else if(sTipo.equals("SeleccionadosProcesoPreciosPorcentaje")) { jCheckBoxSeleccionadosProcesoPreciosPorcentajeItemListener(evt); } else if(sTipo.equals("NuevoToolBarProcesoPreciosPorcentaje")) { } ProcesoPreciosPorcentajeBeanSwingJInternalFrameAdditional.procesarEventosVista(this.parametroGeneralUsuario,this.moduloActual,this.opcionActual,this.usuarioActual,this,FuncionTipo.AFTER,ControlTipo.CHECKBOX,EventoTipo.CLIC,EventoSubTipo.CLICKED,sTipo,this.procesopreciosporcentaje,new Object(),this.procesopreciosporcentajeParameterGeneral,this.procesopreciosporcentajeReturnGeneral); if(esUsoDesdeHijoLocal) { Long id=0L; generalEntityParameterGeneral.setEventoGlobalTipo(EventoGlobalTipo.FORM_HIJO_ACTUALIZAR); generalEntityParameterGeneral.setsDominio("Formulario"); generalEntityParameterGeneral.setsDominioTipo(ProcesoPreciosPorcentaje.class.getName()); if(this.jInternalFrameParent!=null) { this.jInternalFrameParent.setEventoParentGeneral(esUsoDesdeHijoLocal,"Formulario",ProcesoPreciosPorcentaje.class.getName(),sTipo,"TEXTFIELD",esControlTabla,conIrServidorAplicacionParent, id,jCheckBox, EventoGlobalTipo.FORM_HIJO_ACTUALIZAR,ControlTipo.CHECKBOX,EventoTipo.CLIC,EventoSubTipo.CLICKED,arrClasses, evt,generalEntityParameterGeneral,null); } } } } catch(Exception e) { FuncionesSwing.manageException2(this, e,logger,ProcesoPreciosPorcentajeConstantesFunciones.CLASSNAME); } } public void jCheckBoxFocusLostGeneral(String sTipo,java.awt.event.FocusEvent evt) { try { if(this.permiteManejarEventosControl() && this.existeCambioValor(ControlTipo.CHECKBOX,sTipo)) { EventoGlobalTipo eventoGlobalTipo=EventoGlobalTipo.CONTROL_CHANGE; Boolean esControlTabla=false; JCheckBox jCheckBox=null; Container containerParent=null; Component componentOpposite=null; //PARAMETROS LLAMAR FUNCION PARENT GeneralEntityParameterGeneral generalEntityParameterGeneral=new GeneralEntityParameterGeneral(); Boolean esUsoDesdeHijoLocal=false; Boolean conIrServidorAplicacionParent=false; ArrayList<String> arrClasses=new ArrayList<String>(); //PARAMETROS LLAMAR FUNCION PARENT_FIN ArrayList<Classe> classes=new ArrayList<Classe>(); jCheckBox=(JCheckBox)evt.getSource(); containerParent=jCheckBox.getParent(); componentOpposite=evt.getOppositeComponent(); if((containerParent!=null && containerParent.getClass().equals(JTableMe.class)) || (componentOpposite!=null && componentOpposite.getClass().equals(JTableMe.class)) ) { esControlTabla=true; } this.esControlTabla=esControlTabla; /* if(this.esUsoDesdeHijo) { eventoGlobalTipo=EventoGlobalTipo.FORM_HIJO_ACTUALIZAR; } */ //this.actualizarInformacion("EVENTO_CONTROL",false,this.procesopreciosporcentaje); //this.actualizarInformacion("INFO_PADRE",false,this.procesopreciosporcentaje); ProcesoPreciosPorcentajeBeanSwingJInternalFrameAdditional.procesarEventosVista(this.parametroGeneralUsuario,this.moduloActual,this.opcionActual,this.usuarioActual,this,FuncionTipo.BEFORE,ControlTipo.CHECKBOX,EventoTipo.CLIC,EventoSubTipo.CLICKED,sTipo,this.procesopreciosporcentaje,new Object(),this.procesopreciosporcentajeParameterGeneral,this.procesopreciosporcentajeReturnGeneral); ProcesoPreciosPorcentajeBeanSwingJInternalFrameAdditional.procesarEventosVista(this.parametroGeneralUsuario,this.moduloActual,this.opcionActual,this.usuarioActual,this,FuncionTipo.AFTER,ControlTipo.CHECKBOX,EventoTipo.CLIC,EventoSubTipo.CLICKED,sTipo,this.procesopreciosporcentaje,new Object(),this.procesopreciosporcentajeParameterGeneral,this.procesopreciosporcentajeReturnGeneral); if(esUsoDesdeHijoLocal) { Long id=0L; generalEntityParameterGeneral.setEventoGlobalTipo(EventoGlobalTipo.FORM_HIJO_ACTUALIZAR); generalEntityParameterGeneral.setsDominio("Formulario"); generalEntityParameterGeneral.setsDominioTipo(ProcesoPreciosPorcentaje.class.getName()); if(this.jInternalFrameParent!=null) { this.jInternalFrameParent.setEventoParentGeneral(esUsoDesdeHijoLocal,"Formulario",ProcesoPreciosPorcentaje.class.getName(),sTipo,"TEXTFIELD",esControlTabla,conIrServidorAplicacionParent, id,jCheckBox, EventoGlobalTipo.FORM_HIJO_ACTUALIZAR,ControlTipo.CHECKBOX,EventoTipo.CLIC,EventoSubTipo.CLICKED,arrClasses, evt,generalEntityParameterGeneral,null); } } } } catch(Exception e) { FuncionesSwing.manageException2(this, e,logger,ProcesoPreciosPorcentajeConstantesFunciones.CLASSNAME); } } public void jCheckBoxFocusGainedGeneral(String sTipo,java.awt.event.FocusEvent evt) { try { if(this.permiteManejarEventosControl()) { //SELECCIONA FILA A OBJETO ACTUAL this.seleccionarFilaTablaProcesoPreciosPorcentajeActual(); //SELECCIONA FILA A OBJETO ANTERIOR Integer intSelectedRow = this.jTableDatosProcesoPreciosPorcentaje.getSelectedRow(); if(intSelectedRow!=null && intSelectedRow>-1) { //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeAnterior =(ProcesoPreciosPorcentaje) this.procesopreciosporcentajeLogic.getProcesoPreciosPorcentajes().toArray()[this.jTableDatosProcesoPreciosPorcentaje.convertRowIndexToModel(intSelectedRow)]; } else if(Constantes.ISUSAEJBREMOTE || Constantes.ISUSAEJBHOME ) { this.procesopreciosporcentajeAnterior =(ProcesoPreciosPorcentaje) this.procesopreciosporcentajes.toArray()[this.jTableDatosProcesoPreciosPorcentaje.convertRowIndexToModel(intSelectedRow)]; } //ARCHITECTURE //System.out.println(this.banco); } } } catch(Exception e) { FuncionesSwing.manageException2(this, e,logger,ProcesoPreciosPorcentajeConstantesFunciones.CLASSNAME); } } public void jCheckBoxActionPerformedGeneral(String sTipo,ActionEvent evt) { try { if(this.permiteManejarEventosControl()) { //SELECCIONA FILA A OBJETO ACTUAL this.seleccionarFilaTablaProcesoPreciosPorcentajeActual(); this.actualizarInformacion("EVENTO_CONTROL",false,this.procesopreciosporcentaje); this.actualizarInformacion("INFO_PADRE",false,this.procesopreciosporcentaje); ProcesoPreciosPorcentajeBeanSwingJInternalFrameAdditional.procesarEventosVista(this.parametroGeneralUsuario,this.moduloActual,this.opcionActual,this.usuarioActual,this,FuncionTipo.BEFORE,ControlTipo.CHECKBOX,EventoTipo.CLIC,EventoSubTipo.CLICKED,sTipo,this.procesopreciosporcentaje,new Object(),this.procesopreciosporcentajeParameterGeneral,this.procesopreciosporcentajeReturnGeneral); ProcesoPreciosPorcentajeBeanSwingJInternalFrameAdditional.procesarEventosVista(this.parametroGeneralUsuario,this.moduloActual,this.opcionActual,this.usuarioActual,this,FuncionTipo.AFTER,ControlTipo.CHECKBOX,EventoTipo.CLIC,EventoSubTipo.CLICKED,sTipo,this.procesopreciosporcentaje,new Object(),this.procesopreciosporcentajeParameterGeneral,this.procesopreciosporcentajeReturnGeneral); } } catch(Exception e) { FuncionesSwing.manageException2(this, e,logger,ProcesoPreciosPorcentajeConstantesFunciones.CLASSNAME); } } //NO SE UTILIZA, SE USA EL DE ABAJO, IGUAL SE DEJA EL CODIGO COMO RESPALDO Y ES CASI IGUAL //ERROR:SI SE USA,AL HACER CLIC EN EL MISMO ELEMENTO O EJECUTAR SELECTEDITEM, SIEMPRE SE EJECUTA COMO SI ESCOGIERA OTRO ELEMENTO(NO DEBERIA) //@SuppressWarnings("rawtypes") public void jComboBoxActionPerformedGeneral(String sTipo,ActionEvent evt) { try { /* EventoGlobalTipo eventoGlobalTipo=EventoGlobalTipo.CONTROL_CHANGE; if(this.esUsoDesdeHijo) { eventoGlobalTipo=EventoGlobalTipo.FORM_HIJO_ACTUALIZAR; } Container containerParent=null; Component componentOpposite=null; Boolean esControlTabla=false; ArrayList<Classe> classes=new ArrayList<Classe>(); ProcesoPreciosPorcentajeBeanSwingJInternalFrameAdditional.procesarEventosVista(this.parametroGeneralUsuario,this.moduloActual,this.opcionActual,this.usuarioActual,this,FuncionTipo.BEFORE,ControlTipo.COMBOBOX,EventoTipo.CHANGE,EventoSubTipo.CLICKED,sTipo,this.procesopreciosporcentaje,new Object(),this.procesopreciosporcentajeParameterGeneral,this.procesopreciosporcentajeReturnGeneral); JComboBox jComboBoxGenerico=null; if(evt.getSource().getClass().equals(JComboBox.class) || evt.getSource().getClass().equals(JComboBoxMe.class)) { jComboBoxGenerico=(JComboBox)evt.getSource(); containerParent=jComboBoxGenerico.getParent(); componentOpposite=null;//evt.getOppositeComponent(); if((containerParent!=null && containerParent.getClass().equals(JTableMe.class)) || (componentOpposite!=null && componentOpposite.getClass().equals(JTableMe.class)) ) { esControlTabla=true; } this.esControlTabla=esControlTabla; } String sFinalQueryCombo=""; ProcesoPreciosPorcentajeBeanSwingJInternalFrameAdditional.procesarEventosVista(this.parametroGeneralUsuario,this.moduloActual,this.opcionActual,this.usuarioActual,this,FuncionTipo.AFTER,ControlTipo.COMBOBOX,EventoTipo.CHANGE,EventoSubTipo.CHANGED,sTipo,this.procesopreciosporcentaje,new Object(),this.procesopreciosporcentajeParameterGeneral,this.procesopreciosporcentajeReturnGeneral); */ } catch(Exception e) { FuncionesSwing.manageException2(this, e,logger,ProcesoPreciosPorcentajeConstantesFunciones.CLASSNAME); } } @SuppressWarnings("rawtypes") public void jComboBoxItemStateChangedGeneral(String sTipo,ItemEvent evt) { try { if (evt.getStateChange() == ItemEvent.SELECTED && this.permiteManejarEventosControl()) { //SELECCIONA FILA A OBJETO ACTUAL this.seleccionarFilaTablaProcesoPreciosPorcentajeActual(); //PARAMETROS LLAMAR FUNCION PARENT GeneralEntityParameterGeneral generalEntityParameterGeneral=new GeneralEntityParameterGeneral(); Boolean esUsoDesdeHijoLocal=false; Boolean conIrServidorAplicacionParent=false; ArrayList<String> arrClasses=new ArrayList<String>(); //PARAMETROS LLAMAR FUNCION PARENT_FIN EventoGlobalTipo eventoGlobalTipo=EventoGlobalTipo.CONTROL_CHANGE; /* if(this.esUsoDesdeHijo) { eventoGlobalTipo=EventoGlobalTipo.FORM_HIJO_ACTUALIZAR; } */ Container containerParent=null; Component componentOpposite=null; Boolean esControlTabla=false; ArrayList<Classe> classes=new ArrayList<Classe>(); JComboBox jComboBoxGenerico=null; if(evt.getSource().getClass().equals(JComboBox.class) || evt.getSource().getClass().equals(JComboBoxMe.class)) { jComboBoxGenerico=(JComboBox)evt.getSource(); containerParent=jComboBoxGenerico.getParent(); componentOpposite=null;//evt.getOppositeComponent(); if((containerParent!=null && containerParent.getClass().equals(JTableMe.class)) || (componentOpposite!=null && componentOpposite.getClass().equals(JTableMe.class)) ) { esControlTabla=true; } this.esControlTabla=esControlTabla; } this.actualizarInformacion("EVENTO_CONTROL",false,this.procesopreciosporcentaje); this.actualizarInformacion("INFO_PADRE",false,this.procesopreciosporcentaje); ProcesoPreciosPorcentajeBeanSwingJInternalFrameAdditional.procesarEventosVista(this.parametroGeneralUsuario,this.moduloActual,this.opcionActual,this.usuarioActual,this,FuncionTipo.BEFORE,ControlTipo.COMBOBOX,EventoTipo.CHANGE,EventoSubTipo.CLICKED,sTipo,this.procesopreciosporcentaje,new Object(),this.procesopreciosporcentajeParameterGeneral,this.procesopreciosporcentajeReturnGeneral); String sFinalQueryCombo=""; ProcesoPreciosPorcentajeBeanSwingJInternalFrameAdditional.procesarEventosVista(this.parametroGeneralUsuario,this.moduloActual,this.opcionActual,this.usuarioActual,this,FuncionTipo.AFTER,ControlTipo.COMBOBOX,EventoTipo.CHANGE,EventoSubTipo.CHANGED,sTipo,this.procesopreciosporcentaje,new Object(),this.procesopreciosporcentajeParameterGeneral,this.procesopreciosporcentajeReturnGeneral); if(esUsoDesdeHijoLocal) { Long id=0L; generalEntityParameterGeneral.setEventoGlobalTipo(EventoGlobalTipo.FORM_HIJO_ACTUALIZAR); generalEntityParameterGeneral.setsDominio("Formulario"); generalEntityParameterGeneral.setsDominioTipo(ProcesoPreciosPorcentaje.class.getName()); if(this.jInternalFrameParent!=null) { this.jInternalFrameParent.setEventoParentGeneral(esUsoDesdeHijoLocal,"Formulario",ProcesoPreciosPorcentaje.class.getName(),sTipo,"COMBOBOX",esControlTabla,conIrServidorAplicacionParent, id,jComboBoxGenerico, EventoGlobalTipo.FORM_HIJO_ACTUALIZAR,ControlTipo.COMBOBOX,EventoTipo.CHANGE,EventoSubTipo.CHANGED,arrClasses, evt,generalEntityParameterGeneral,null); } } } } catch(Exception e) { FuncionesSwing.manageException2(this, e,logger,ProcesoPreciosPorcentajeConstantesFunciones.CLASSNAME); } } //@SuppressWarnings("rawtypes") public void jComboBoxFocusLostGeneral(String sTipo,java.awt.event.FocusEvent evt) { //MANEJADO EN ITEMLISTENER /* try { if(this.permiteManejarEventosControl()) { EventoGlobalTipo eventoGlobalTipo=EventoGlobalTipo.CONTROL_CHANGE; //if(this.esUsoDesdeHijo) { // eventoGlobalTipo=EventoGlobalTipo.FORM_HIJO_ACTUALIZAR; //} Container containerParent=null; Component componentOpposite=null; Boolean esControlTabla=false; ArrayList<Classe> classes=new ArrayList<Classe>(); //PARAMETROS LLAMAR FUNCION PARENT GeneralEntityParameterGeneral generalEntityParameterGeneral=new GeneralEntityParameterGeneral(); Boolean esUsoDesdeHijoLocal=false; Boolean conIrServidorAplicacionParent=false; ArrayList<String> arrClasses=new ArrayList<String>(); //PARAMETROS LLAMAR FUNCION PARENT_FIN this.actualizarInformacion("EVENTO_CONTROL",false,this.procesopreciosporcentaje); this.actualizarInformacion("INFO_PADRE",false,this.procesopreciosporcentaje); ProcesoPreciosPorcentajeBeanSwingJInternalFrameAdditional.procesarEventosVista(this.parametroGeneralUsuario,this.moduloActual,this.opcionActual,this.usuarioActual,this,FuncionTipo.BEFORE,ControlTipo.COMBOBOX,EventoTipo.CHANGE,EventoSubTipo.CLICKED,sTipo,this.procesopreciosporcentaje,new Object(),this.procesopreciosporcentajeParameterGeneral,this.procesopreciosporcentajeReturnGeneral); JComboBox jComboBoxGenerico=null; if(evt.getSource().getClass().equals(JComboBox.class) || evt.getSource().getClass().equals(JComboBoxMe.class)) { jComboBoxGenerico=(JComboBox)evt.getSource(); containerParent=jComboBoxGenerico.getParent(); componentOpposite=evt.getOppositeComponent(); if((containerParent!=null && containerParent.getClass().equals(JTableMe.class)) || (componentOpposite!=null && componentOpposite.getClass().equals(JTableMe.class)) ) { esControlTabla=true; } this.esControlTabla=esControlTabla; } String sFinalQueryCombo=""; ProcesoPreciosPorcentajeBeanSwingJInternalFrameAdditional.procesarEventosVista(this.parametroGeneralUsuario,this.moduloActual,this.opcionActual,this.usuarioActual,this,FuncionTipo.AFTER,ControlTipo.COMBOBOX,EventoTipo.CHANGE,EventoSubTipo.CHANGED,sTipo,this.procesopreciosporcentaje,new Object(),this.procesopreciosporcentajeParameterGeneral,this.procesopreciosporcentajeReturnGeneral); if(esUsoDesdeHijoLocal) { Long id=0L; generalEntityParameterGeneral.setEventoGlobalTipo(EventoGlobalTipo.FORM_HIJO_ACTUALIZAR); generalEntityParameterGeneral.setsDominio("Formulario"); generalEntityParameterGeneral.setsDominioTipo(ProcesoPreciosPorcentaje.class.getName()); if(this.jInternalFrameParent!=null) { this.jInternalFrameParent.setEventoParentGeneral(esUsoDesdeHijoLocal,"Formulario",ProcesoPreciosPorcentaje.class.getName(),sTipo,"TEXTFIELD",esControlTabla,conIrServidorAplicacionParent, id,jComboBoxGenerico, EventoGlobalTipo.FORM_HIJO_ACTUALIZAR,ControlTipo.COMBOBOX,EventoTipo.CHANGE,EventoSubTipo.CHANGED,arrClasses, evt,generalEntityParameterGeneral,null); } } } } catch(Exception e) { FuncionesSwing.manageException2(this, e,logger,ProcesoPreciosPorcentajeConstantesFunciones.CLASSNAME); } */ } public void jComboBoxFocusGainedGeneral(String sTipo,java.awt.event.FocusEvent evt) { try { //SELECCIONA FILA A OBJETO ACTUAL this.seleccionarFilaTablaProcesoPreciosPorcentajeActual(); //SELECCIONA FILA A OBJETO ANTERIOR Integer intSelectedRow = this.jTableDatosProcesoPreciosPorcentaje.getSelectedRow(); if(intSelectedRow!=null && intSelectedRow>-1) { //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeAnterior =(ProcesoPreciosPorcentaje) this.procesopreciosporcentajeLogic.getProcesoPreciosPorcentajes().toArray()[this.jTableDatosProcesoPreciosPorcentaje.convertRowIndexToModel(intSelectedRow)]; } else if(Constantes.ISUSAEJBREMOTE || Constantes.ISUSAEJBHOME ) { this.procesopreciosporcentajeAnterior =(ProcesoPreciosPorcentaje) this.procesopreciosporcentajes.toArray()[this.jTableDatosProcesoPreciosPorcentaje.convertRowIndexToModel(intSelectedRow)]; } //ARCHITECTURE //System.out.println(this.banco); } } catch(Exception e) { FuncionesSwing.manageException2(this, e,logger,ProcesoPreciosPorcentajeConstantesFunciones.CLASSNAME); } } public void tableValueChangedGeneral(String sTipo,ListSelectionEvent evt) { try { if(this.permiteManejarEventosControl()) { ProcesoPreciosPorcentajeBeanSwingJInternalFrameAdditional.procesarEventosVista(this.parametroGeneralUsuario,this.moduloActual,this.opcionActual,this.usuarioActual,this,FuncionTipo.BEFORE,ControlTipo.TABLE,EventoTipo.CHANGE,EventoSubTipo.CHANGED,sTipo,this.procesopreciosporcentaje,new Object(),this.procesopreciosporcentajeParameterGeneral,this.procesopreciosporcentajeReturnGeneral); if(sTipo.equals("TableDatosSeleccionarProcesoPreciosPorcentaje")) { //BYDAN_DESHABILITADO //try {jTableDatosProcesoPreciosPorcentajeListSelectionListener(e);}catch(Exception e1){e1.printStackTrace();} //SOLO CUANDO MOUSE ES SOLTADO if (!evt.getValueIsAdjusting()) { //SELECCIONA FILA A OBJETO ACTUAL Integer intSelectedRow = this.jTableDatosProcesoPreciosPorcentaje.getSelectedRow(); if(intSelectedRow!=null && intSelectedRow>-1) { //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentaje =(ProcesoPreciosPorcentaje) this.procesopreciosporcentajeLogic.getProcesoPreciosPorcentajes().toArray()[this.jTableDatosProcesoPreciosPorcentaje.convertRowIndexToModel(intSelectedRow)]; } else if(Constantes.ISUSAEJBREMOTE || Constantes.ISUSAEJBHOME ) { this.procesopreciosporcentaje =(ProcesoPreciosPorcentaje) this.procesopreciosporcentajes.toArray()[this.jTableDatosProcesoPreciosPorcentaje.convertRowIndexToModel(intSelectedRow)]; } //ARCHITECTURE //System.out.println(this.procesopreciosporcentaje); } } } else if(sTipo.equals("jButtonCancelarProcesoPreciosPorcentaje")) { } ProcesoPreciosPorcentajeBeanSwingJInternalFrameAdditional.procesarEventosVista(this.parametroGeneralUsuario,this.moduloActual,this.opcionActual,this.usuarioActual,this,FuncionTipo.AFTER,ControlTipo.TABLE,EventoTipo.CHANGE,EventoSubTipo.CHANGED,sTipo,this.procesopreciosporcentaje,new Object(),this.procesopreciosporcentajeParameterGeneral,this.procesopreciosporcentajeReturnGeneral); } } catch(Exception e) { FuncionesSwing.manageException2(this, e,logger,ProcesoPreciosPorcentajeConstantesFunciones.CLASSNAME); } } public void tableMouseAdapterGeneral(String sTipo,MouseEvent evt) { try { ProcesoPreciosPorcentajeBeanSwingJInternalFrameAdditional.procesarEventosVista(this.parametroGeneralUsuario,this.moduloActual,this.opcionActual,this.usuarioActual,this,FuncionTipo.BEFORE,ControlTipo.TABLE,EventoTipo.MOUSE,EventoSubTipo.CLICKED,sTipo,this.procesopreciosporcentaje,new Object(),this.procesopreciosporcentajeParameterGeneral,this.procesopreciosporcentajeReturnGeneral); if(sTipo.equals("DatosSeleccionarProcesoPreciosPorcentaje")) { if (evt.getClickCount() == 2) { jButtonIdActionPerformed(null,jTableDatosProcesoPreciosPorcentaje.getSelectedRow(),false,false); } } else if(sTipo.equals("jButtonCancelarProcesoPreciosPorcentaje")) { } ProcesoPreciosPorcentajeBeanSwingJInternalFrameAdditional.procesarEventosVista(this.parametroGeneralUsuario,this.moduloActual,this.opcionActual,this.usuarioActual,this,FuncionTipo.AFTER,ControlTipo.TABLE,EventoTipo.MOUSE,EventoSubTipo.CLICKED,sTipo,this.procesopreciosporcentaje,new Object(),this.procesopreciosporcentajeParameterGeneral,this.procesopreciosporcentajeReturnGeneral); } catch(Exception e) { FuncionesSwing.manageException2(this, e,logger,ProcesoPreciosPorcentajeConstantesFunciones.CLASSNAME); } } ; public void jButtonActionPerformedTecladoGeneral(String sTipo,ActionEvent evt) { try { this.startProcessProcesoPreciosPorcentaje(); ProcesoPreciosPorcentajeBeanSwingJInternalFrameAdditional.procesarEventosVista(this.parametroGeneralUsuario,this.moduloActual,this.opcionActual,this.usuarioActual,this,FuncionTipo.BEFORE,ControlTipo.KEY,EventoTipo.CLIC,EventoSubTipo.CLICKED,sTipo,this.procesopreciosporcentaje,new Object(),this.procesopreciosporcentajeParameterGeneral,this.procesopreciosporcentajeReturnGeneral); if(sTipo.equals("NuevoProcesoPreciosPorcentaje")) { jButtonNuevoProcesoPreciosPorcentajeActionPerformed(evt,false); } else if(sTipo.equals("DuplicarProcesoPreciosPorcentaje")) { jButtonDuplicarProcesoPreciosPorcentajeActionPerformed(evt,false); } else if(sTipo.equals("CopiarProcesoPreciosPorcentaje")) { jButtonCopiarProcesoPreciosPorcentajeActionPerformed(evt); } else if(sTipo.equals("VerFormProcesoPreciosPorcentaje")) { jButtonVerFormProcesoPreciosPorcentajeActionPerformed(evt); } else if(sTipo.equals("NuevoRelacionesProcesoPreciosPorcentaje")) { jButtonNuevoProcesoPreciosPorcentajeActionPerformed(evt,true); } else if(sTipo.equals("ModificarProcesoPreciosPorcentaje")) { jButtonModificarProcesoPreciosPorcentajeActionPerformed(evt); } else if(sTipo.equals("ActualizarProcesoPreciosPorcentaje")) { jButtonActualizarProcesoPreciosPorcentajeActionPerformed(evt); } else if(sTipo.equals("EliminarProcesoPreciosPorcentaje")) { jButtonEliminarProcesoPreciosPorcentajeActionPerformed(evt); } else if(sTipo.equals("GuardarCambiosTablaProcesoPreciosPorcentaje")) { jButtonGuardarCambiosProcesoPreciosPorcentajeActionPerformed(evt); } else if(sTipo.equals("CancelarProcesoPreciosPorcentaje")) { jButtonCancelarProcesoPreciosPorcentajeActionPerformed(evt); } else if(sTipo.equals("CerrarProcesoPreciosPorcentaje")) { jButtonCerrarProcesoPreciosPorcentajeActionPerformed(evt); } else if(sTipo.equals("GuardarCambiosProcesoPreciosPorcentaje")) { jButtonGuardarCambiosProcesoPreciosPorcentajeActionPerformed(evt); } else if(sTipo.equals("NuevoGuardarCambiosProcesoPreciosPorcentaje")) { jButtonNuevoGuardarCambiosProcesoPreciosPorcentajeActionPerformed(evt); } else if(sTipo.equals("AbrirOrderByProcesoPreciosPorcentaje")) { jButtonAbrirOrderByProcesoPreciosPorcentajeActionPerformed(evt); } else if(sTipo.equals("RecargarInformacionProcesoPreciosPorcentaje")) { jButtonRecargarInformacionProcesoPreciosPorcentajeActionPerformed(evt); } else if(sTipo.equals("AnterioresProcesoPreciosPorcentaje")) { jButtonAnterioresProcesoPreciosPorcentajeActionPerformed(evt); } else if(sTipo.equals("SiguientesProcesoPreciosPorcentaje")) { jButtonSiguientesProcesoPreciosPorcentajeActionPerformed(evt); } //BUSQUEDA GENERAL CAMPO else if(sTipo.equals("idProcesoPreciosPorcentajeBusqueda")) { this.jButtonidProcesoPreciosPorcentajeBusquedaActionPerformed(evt); } //ACTUALIZAR CAMPO else if(sTipo.equals("id_bodegaProcesoPreciosPorcentajeUpdate")) { this.jButtonid_bodegaProcesoPreciosPorcentajeUpdateActionPerformed(evt); } //BUSQUEDA GENERAL CAMPO else if(sTipo.equals("id_bodegaProcesoPreciosPorcentajeBusqueda")) { this.jButtonid_bodegaProcesoPreciosPorcentajeBusquedaActionPerformed(evt); } //ACTUALIZAR CAMPO else if(sTipo.equals("id_productoProcesoPreciosPorcentajeUpdate")) { this.jButtonid_productoProcesoPreciosPorcentajeUpdateActionPerformed(evt); } //BUSQUEDA GENERAL CAMPO else if(sTipo.equals("id_productoProcesoPreciosPorcentajeBusqueda")) { this.jButtonid_productoProcesoPreciosPorcentajeBusquedaActionPerformed(evt); } //ACTUALIZAR CAMPO else if(sTipo.equals("id_empresaProcesoPreciosPorcentajeUpdate")) { this.jButtonid_empresaProcesoPreciosPorcentajeUpdateActionPerformed(evt); } //BUSQUEDA GENERAL CAMPO else if(sTipo.equals("id_empresaProcesoPreciosPorcentajeBusqueda")) { this.jButtonid_empresaProcesoPreciosPorcentajeBusquedaActionPerformed(evt); } //ACTUALIZAR CAMPO else if(sTipo.equals("id_sucursalProcesoPreciosPorcentajeUpdate")) { this.jButtonid_sucursalProcesoPreciosPorcentajeUpdateActionPerformed(evt); } //BUSQUEDA GENERAL CAMPO else if(sTipo.equals("id_sucursalProcesoPreciosPorcentajeBusqueda")) { this.jButtonid_sucursalProcesoPreciosPorcentajeBusquedaActionPerformed(evt); } //ACTUALIZAR CAMPO else if(sTipo.equals("id_lineaProcesoPreciosPorcentajeUpdate")) { this.jButtonid_lineaProcesoPreciosPorcentajeUpdateActionPerformed(evt); } //BUSQUEDA GENERAL CAMPO else if(sTipo.equals("id_lineaProcesoPreciosPorcentajeBusqueda")) { this.jButtonid_lineaProcesoPreciosPorcentajeBusquedaActionPerformed(evt); } //ACTUALIZAR CAMPO else if(sTipo.equals("id_linea_grupoProcesoPreciosPorcentajeUpdate")) { this.jButtonid_linea_grupoProcesoPreciosPorcentajeUpdateActionPerformed(evt); } //BUSQUEDA GENERAL CAMPO else if(sTipo.equals("id_linea_grupoProcesoPreciosPorcentajeBusqueda")) { this.jButtonid_linea_grupoProcesoPreciosPorcentajeBusquedaActionPerformed(evt); } //ACTUALIZAR CAMPO else if(sTipo.equals("id_linea_categoriaProcesoPreciosPorcentajeUpdate")) { this.jButtonid_linea_categoriaProcesoPreciosPorcentajeUpdateActionPerformed(evt); } //BUSQUEDA GENERAL CAMPO else if(sTipo.equals("id_linea_categoriaProcesoPreciosPorcentajeBusqueda")) { this.jButtonid_linea_categoriaProcesoPreciosPorcentajeBusquedaActionPerformed(evt); } //ACTUALIZAR CAMPO else if(sTipo.equals("id_linea_marcaProcesoPreciosPorcentajeUpdate")) { this.jButtonid_linea_marcaProcesoPreciosPorcentajeUpdateActionPerformed(evt); } //BUSQUEDA GENERAL CAMPO else if(sTipo.equals("id_linea_marcaProcesoPreciosPorcentajeBusqueda")) { this.jButtonid_linea_marcaProcesoPreciosPorcentajeBusquedaActionPerformed(evt); } //BUSQUEDA GENERAL CAMPO else if(sTipo.equals("codigoProcesoPreciosPorcentajeBusqueda")) { this.jButtoncodigoProcesoPreciosPorcentajeBusquedaActionPerformed(evt); } //BUSQUEDA GENERAL CAMPO else if(sTipo.equals("nombreProcesoPreciosPorcentajeBusqueda")) { this.jButtonnombreProcesoPreciosPorcentajeBusquedaActionPerformed(evt); } //BUSQUEDA GENERAL CAMPO else if(sTipo.equals("codigo_productoProcesoPreciosPorcentajeBusqueda")) { this.jButtoncodigo_productoProcesoPreciosPorcentajeBusquedaActionPerformed(evt); } //BUSQUEDA GENERAL CAMPO else if(sTipo.equals("nombre_productoProcesoPreciosPorcentajeBusqueda")) { this.jButtonnombre_productoProcesoPreciosPorcentajeBusquedaActionPerformed(evt); } //BUSQUEDA GENERAL CAMPO else if(sTipo.equals("precioProcesoPreciosPorcentajeBusqueda")) { this.jButtonprecioProcesoPreciosPorcentajeBusquedaActionPerformed(evt); } //BUSQUEDA GENERAL CAMPO else if(sTipo.equals("porcentajeProcesoPreciosPorcentajeBusqueda")) { this.jButtonporcentajeProcesoPreciosPorcentajeBusquedaActionPerformed(evt); } ProcesoPreciosPorcentajeBeanSwingJInternalFrameAdditional.procesarEventosVista(this.parametroGeneralUsuario,this.moduloActual,this.opcionActual,this.usuarioActual,this,FuncionTipo.AFTER,ControlTipo.KEY,EventoTipo.CLIC,EventoSubTipo.CLICKED,sTipo,this.procesopreciosporcentaje,new Object(),this.procesopreciosporcentajeParameterGeneral,this.procesopreciosporcentajeReturnGeneral); } catch(Exception e) { FuncionesSwing.manageException2(this, e,logger,ProcesoPreciosPorcentajeConstantesFunciones.CLASSNAME); } finally { this.finishProcessProcesoPreciosPorcentaje(); } } public void internalFrameClosingInternalFrameGeneral(String sTipo,InternalFrameEvent evt) { try { ProcesoPreciosPorcentajeBeanSwingJInternalFrameAdditional.procesarEventosVista(this.parametroGeneralUsuario,this.moduloActual,this.opcionActual,this.usuarioActual,this,FuncionTipo.BEFORE,ControlTipo.WINDOW,EventoTipo.CLIC,EventoSubTipo.CLOSING,sTipo,this.procesopreciosporcentaje,new Object(),this.procesopreciosporcentajeParameterGeneral,this.procesopreciosporcentajeReturnGeneral); if(sTipo.equals("CloseInternalFrameProcesoPreciosPorcentaje")) { closingInternalFrameProcesoPreciosPorcentaje(); } else if(sTipo.equals("jButtonCancelarProcesoPreciosPorcentaje")) { JInternalFrameBase jInternalFrameDetalleFormProcesoPreciosPorcentaje = (JInternalFrameBase)evt.getSource(); ProcesoPreciosPorcentajeBeanSwingJInternalFrame jInternalFrameParent=(ProcesoPreciosPorcentajeBeanSwingJInternalFrame)jInternalFrameDetalleFormProcesoPreciosPorcentaje.getjInternalFrameParent(); jInternalFrameParent.jButtonCancelarProcesoPreciosPorcentajeActionPerformed(null); } ProcesoPreciosPorcentajeBeanSwingJInternalFrameAdditional.procesarEventosVista(this.parametroGeneralUsuario,this.moduloActual,this.opcionActual,this.usuarioActual,this,FuncionTipo.AFTER,ControlTipo.WINDOW,EventoTipo.CLIC,EventoSubTipo.CLOSING,sTipo,this.procesopreciosporcentaje,new Object(),this.procesopreciosporcentajeParameterGeneral,this.procesopreciosporcentajeReturnGeneral); } catch(Exception e) { FuncionesSwing.manageException2(this, e,logger,ProcesoPreciosPorcentajeConstantesFunciones.CLASSNAME); } } public void recargarFormProcesoPreciosPorcentaje(String sTipo,String sDominio,EventoGlobalTipo eventoGlobalTipo,ControlTipo controlTipo,EventoTipo eventoTipo,EventoSubTipo eventoSubTipo,String sTipoGeneral,ArrayList<Classe> classes,Boolean conIrServidorAplicacion) throws Exception { this.recargarFormProcesoPreciosPorcentaje(sTipo,sDominio,eventoGlobalTipo,controlTipo,eventoTipo,eventoSubTipo,sTipoGeneral,classes,conIrServidorAplicacion,false); } public void recargarFormProcesoPreciosPorcentaje(String sTipo,String sDominio,EventoGlobalTipo eventoGlobalTipo,ControlTipo controlTipo,EventoTipo eventoTipo,EventoSubTipo eventoSubTipo,String sTipoGeneral,ArrayList<Classe> classes,Boolean conIrServidorAplicacion,Boolean esControlTabla) throws Exception { if(this.permiteRecargarForm && this.permiteMantenimiento(this.procesopreciosporcentaje)) { if(!esControlTabla) { if(ProcesoPreciosPorcentajeJInternalFrame.ISBINDING_MANUAL_TABLA) { this.setVariablesFormularioToObjetoActualProcesoPreciosPorcentaje(this.procesopreciosporcentaje,true,false); this.setVariablesFormularioToObjetoActualForeignKeysProcesoPreciosPorcentaje(this.procesopreciosporcentaje); } if(this.procesopreciosporcentajeSessionBean.getEstaModoGuardarRelaciones()) { this.setVariablesFormularioRelacionesToObjetoActualProcesoPreciosPorcentaje(this.procesopreciosporcentaje,classes); } if(conIrServidorAplicacion) { //ACTUALIZA VARIABLES DEFECTO DESDE LOGIC A RETURN GENERAL Y LUEGO A BEAN //this.setVariablesObjetoReturnGeneralToBeanProcesoPreciosPorcentaje(this.procesopreciosporcentajeReturnGeneral,this.procesopreciosporcentajeBean,false); //ACTUALIZA VARIABLES RELACIONES DEFECTO DESDE LOGIC A RETURN GENERAL Y LUEGO A BEAN if(this.procesopreciosporcentajeSessionBean.getEstaModoGuardarRelaciones()) { //this.setVariablesRelacionesObjetoReturnGeneralToBeanProcesoPreciosPorcentaje(classes,this.procesopreciosporcentajeReturnGeneral,this.procesopreciosporcentajeBean,false); } if(this.procesopreciosporcentajeReturnGeneral.getConRecargarPropiedades()) { //INICIALIZA VARIABLES COMBOS NORMALES (FK) this.setVariablesObjetoActualToFormularioForeignKeyProcesoPreciosPorcentaje(this.procesopreciosporcentajeReturnGeneral.getProcesoPreciosPorcentaje()); //INICIALIZA VARIABLES NORMALES A FORMULARIO(SIN FK) this.setVariablesObjetoActualToFormularioProcesoPreciosPorcentaje(this.procesopreciosporcentajeReturnGeneral.getProcesoPreciosPorcentaje()); } if(this.procesopreciosporcentajeReturnGeneral.getConRecargarRelaciones()) { //INICIALIZA VARIABLES RELACIONES A FORMULARIO this.setVariablesRelacionesObjetoActualToFormularioProcesoPreciosPorcentaje(this.procesopreciosporcentajeReturnGeneral.getProcesoPreciosPorcentaje(),classes);//this.procesopreciosporcentajeBean); } } else { //INICIALIZA VARIABLES RELACIONES A FORMULARIO this.setVariablesRelacionesObjetoActualToFormularioProcesoPreciosPorcentaje(this.procesopreciosporcentaje,classes);//this.procesopreciosporcentajeBean); } if(ProcesoPreciosPorcentajeJInternalFrame.ISBINDING_MANUAL_TABLA) { this.setVariablesFormularioToObjetoActualProcesoPreciosPorcentaje(this.procesopreciosporcentaje,true,false); this.setVariablesFormularioToObjetoActualForeignKeysProcesoPreciosPorcentaje(this.procesopreciosporcentaje); } } else { if(((controlTipo.equals(ControlTipo.TEXTBOX) || controlTipo.equals(ControlTipo.DATE) || controlTipo.equals(ControlTipo.TEXTAREA) || controlTipo.equals(ControlTipo.COMBOBOX) ) && eventoTipo.equals(EventoTipo.CHANGE) ) || (controlTipo.equals(ControlTipo.CHECKBOX) && eventoTipo.equals(EventoTipo.CLIC)) ) { // && sTipoGeneral.equals("TEXTBOX") if(this.procesopreciosporcentajeAnterior!=null) { this.procesopreciosporcentaje=this.procesopreciosporcentajeAnterior; } } if(conIrServidorAplicacion) { } //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { //NO ENTENDIBLE PORQUE PONER //if(this.procesopreciosporcentajeSessionBean.getEstaModoGuardarRelaciones() // || this.procesopreciosporcentajeSessionBean.getEsGuardarRelacionado()) { actualizarLista(this.procesopreciosporcentajeReturnGeneral.getProcesoPreciosPorcentaje(),procesopreciosporcentajeLogic.getProcesoPreciosPorcentajes()); //} } else if(Constantes.ISUSAEJBREMOTE||Constantes.ISUSAEJBHOME) { actualizarLista(this.procesopreciosporcentajeReturnGeneral.getProcesoPreciosPorcentaje(),this.procesopreciosporcentajes); } //ARCHITECTURE //this.jTableDatosProcesoPreciosPorcentaje.repaint(); //((AbstractTableModel) this.jTableDatosProcesoPreciosPorcentaje.getModel()).fireTableDataChanged(); this.actualizarVisualTableDatosProcesoPreciosPorcentaje(); } } } public void actualizarVisualTableDatosProcesoPreciosPorcentaje() throws Exception { ProcesoPreciosPorcentajeModel procesopreciosporcentajeModel=(ProcesoPreciosPorcentajeModel)this.jTableDatosProcesoPreciosPorcentaje.getModel(); if(Constantes.ISUSAEJBLOGICLAYER) { procesopreciosporcentajeModel.procesopreciosporcentajes=this.procesopreciosporcentajeLogic.getProcesoPreciosPorcentajes(); } else if(Constantes.ISUSAEJBREMOTE || Constantes.ISUSAEJBHOME ) { procesopreciosporcentajeModel.procesopreciosporcentajes=this.procesopreciosporcentajes; } ((ProcesoPreciosPorcentajeModel) this.jTableDatosProcesoPreciosPorcentaje.getModel()).fireTableDataChanged(); } public void actualizarVisualTableDatosEventosVistaProcesoPreciosPorcentaje() throws Exception { //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { this.actualizarLista(this.getprocesopreciosporcentajeAnterior(),this.procesopreciosporcentajeLogic.getProcesoPreciosPorcentajes()); } else if(Constantes.ISUSAEJBREMOTE||Constantes.ISUSAEJBHOME) { this.actualizarLista(this.getprocesopreciosporcentajeAnterior(),this.procesopreciosporcentajes); } //ARCHITECTURE this.actualizarFilaTotales(); this.actualizarVisualTableDatosProcesoPreciosPorcentaje(); } public void setVariablesRelacionesObjetoActualToFormularioProcesoPreciosPorcentaje(ProcesoPreciosPorcentaje procesopreciosporcentaje,ArrayList<Classe> classes) throws Exception { try { } catch(Exception e) { FuncionesSwing.manageException(this, e,logger,ProcesoPreciosPorcentajeConstantesFunciones.CLASSNAME); } } public void setEventoParentGeneral(Boolean esUsoDesdeHijo,String sDominio,String sDominioTipo,String sTipo,String sTipoGeneral,Boolean esControlTabla,Boolean conIrServidorAplicacion, Long id,Component control, EventoGlobalTipo eventoGlobalTipo,ControlTipo controlTipo,EventoTipo eventoTipo,EventoSubTipo eventoSubTipo,ArrayList<String> arrClasses, Object evt,GeneralEntityParameterReturnGeneral generalEntityParameterGeneral,Object otro) { try { if(this.permiteManejarEventosControl()) { //BASE COPIADO DESDE TEXTFIELLOSTFOCUS //EventoGlobalTipo.FORM_HIJO_ACTUALIZAR; Boolean conTodasRelaciones=false; this.esUsoDesdeHijo=esUsoDesdeHijo; ProcesoPreciosPorcentajeBeanSwingJInternalFrameAdditional.procesarEventosVista(this.parametroGeneralUsuario,this.moduloActual,this.opcionActual,this.usuarioActual,this,FuncionTipo.BEFORE,controlTipo,eventoTipo,eventoSubTipo,sTipo,this.procesopreciosporcentaje,new Object(),generalEntityParameterGeneral,this.procesopreciosporcentajeReturnGeneral); ArrayList<Classe> classes=new ArrayList<Classe>(); for(String sClasse:arrClasses) { if(sClasse.equals("TODOS")) { conTodasRelaciones=true; break; } } if(this.procesopreciosporcentajeSessionBean.getConGuardarRelaciones()) { if(conTodasRelaciones) { classes=ProcesoPreciosPorcentajeConstantesFunciones.getClassesRelationshipsOfProcesoPreciosPorcentaje(new ArrayList<Classe>(),DeepLoadType.NONE); } else { classes=ProcesoPreciosPorcentajeConstantesFunciones.getClassesRelationshipsFromStringsOfProcesoPreciosPorcentaje(arrClasses,DeepLoadType.NONE); } } this.classesActual=new ArrayList<Classe>(); this.classesActual.addAll(classes); this.recargarFormProcesoPreciosPorcentaje(sTipo,sDominio,eventoGlobalTipo,controlTipo,eventoTipo,eventoSubTipo,sTipoGeneral,classes,conIrServidorAplicacion,esControlTabla); ProcesoPreciosPorcentajeBeanSwingJInternalFrameAdditional.procesarEventosVista(this.parametroGeneralUsuario,this.moduloActual,this.opcionActual,this.usuarioActual,this,FuncionTipo.AFTER,controlTipo,eventoTipo,eventoSubTipo,sTipo,this.procesopreciosporcentaje,new Object(),generalEntityParameterGeneral,this.procesopreciosporcentajeReturnGeneral); } } catch(Exception e) { FuncionesSwing.manageException2(this, e,logger,ProcesoPreciosPorcentajeConstantesFunciones.CLASSNAME); } } /* public void setVariablesRelacionesObjetoBeanActualToFormularioProcesoPreciosPorcentaje(ProcesoPreciosPorcentajeBean procesopreciosporcentajeBean) throws Exception { try { } catch(Exception e) { FuncionesSwing.manageException(this, e,logger,ProcesoPreciosPorcentajeConstantesFunciones.CLASSNAME); } } */ /* public void setVariablesRelacionesObjetoReturnGeneralToBeanProcesoPreciosPorcentaje(ArrayList<Classe> classes,ProcesoPreciosPorcentajeReturnGeneral procesopreciosporcentajeReturnGeneral,ProcesoPreciosPorcentajeBean procesopreciosporcentajeBean,Boolean conDefault) throws Exception { } */ public void setVariablesFormularioRelacionesToObjetoActualProcesoPreciosPorcentaje(ProcesoPreciosPorcentaje procesopreciosporcentaje,ArrayList<Classe> classes) throws Exception { } public Boolean permiteManejarEventosControl() { Boolean permite=true; if(this.estaModoNuevo || this.estaModoSeleccionar || this.estaModoEliminarGuardarCambios) { permite=false; } //NO DEBE MEZCLARSE CONCEPTOS /* if(!paraTabla && !this.permiteMantenimiento(this.procesopreciosporcentaje)) { System.out.println("ERROR:EL OBJETO ACTUAL NO PUEDE SER FILA TOTALES"); //JOptionPane.showMessageDialog(this,"EL OBJETO ACTUAL NO PUEDE SER FILA TOTALES","EVENTO",JOptionPane.ERROR_MESSAGE); } */ return permite; } public void inicializarFormDetalle() throws Exception { this.jInternalFrameDetalleFormProcesoPreciosPorcentaje = new ProcesoPreciosPorcentajeDetalleFormJInternalFrame(jDesktopPane,this.procesopreciosporcentajeSessionBean.getConGuardarRelaciones(),this.procesopreciosporcentajeSessionBean.getEsGuardarRelacionado(),this.cargarRelaciones,usuarioActual,resumenUsuarioActual,moduloActual,opcionActual,parametroGeneralSg,parametroGeneralUsuario,paginaTipo); this.jDesktopPane.add(this.jInternalFrameDetalleFormProcesoPreciosPorcentaje); this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.setVisible(false); this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.setSelected(false); this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.setJInternalFrameParent(this); this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.procesopreciosporcentajeLogic=this.procesopreciosporcentajeLogic; this.cargarCombosFrameForeignKeyProcesoPreciosPorcentaje("Formulario"); this.inicializarActualizarBindingBotonesPermisosManualFormDetalleProcesoPreciosPorcentaje(); this.inicializarActualizarBindingtiposArchivosReportesAccionesManualFormDetalleProcesoPreciosPorcentaje(); this.initActionsFormDetalle(); this.initActionsCombosTodosForeignKeyProcesoPreciosPorcentaje("Formulario"); //TALVEZ conSetVariablesGlobales COMO if() this.setVariablesGlobalesCombosForeignKeyProcesoPreciosPorcentaje(); this.cargarMenuRelaciones(); } public void initActionsFormDetalle() { this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.addInternalFrameListener(new InternalFrameInternalFrameAdapter(this,"jButtonCancelarProcesoPreciosPorcentaje")); this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jButtonModificarProcesoPreciosPorcentaje.addActionListener(new ButtonActionListener(this,"ModificarProcesoPreciosPorcentaje")); this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jButtonModificarToolBarProcesoPreciosPorcentaje.addActionListener(new ButtonActionListener(this,"ModificarToolBarProcesoPreciosPorcentaje")); this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jMenuItemModificarProcesoPreciosPorcentaje.addActionListener(new ButtonActionListener(this,"MenuItemModificarProcesoPreciosPorcentaje")); this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jButtonActualizarProcesoPreciosPorcentaje.addActionListener (new ButtonActionListener(this,"ActualizarProcesoPreciosPorcentaje")); this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jButtonActualizarToolBarProcesoPreciosPorcentaje.addActionListener(new ButtonActionListener(this,"ActualizarToolBarProcesoPreciosPorcentaje")); this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jMenuItemActualizarProcesoPreciosPorcentaje.addActionListener (new ButtonActionListener(this,"MenuItemActualizarProcesoPreciosPorcentaje")); this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jButtonEliminarProcesoPreciosPorcentaje.addActionListener (new ButtonActionListener(this,"EliminarProcesoPreciosPorcentaje")); this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jButtonEliminarToolBarProcesoPreciosPorcentaje.addActionListener (new ButtonActionListener(this,"EliminarToolBarProcesoPreciosPorcentaje")); this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jMenuItemEliminarProcesoPreciosPorcentaje.addActionListener (new ButtonActionListener(this,"MenuItemEliminarProcesoPreciosPorcentaje")); this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jButtonCancelarProcesoPreciosPorcentaje.addActionListener (new ButtonActionListener(this,"CancelarProcesoPreciosPorcentaje")); this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jButtonCancelarToolBarProcesoPreciosPorcentaje.addActionListener (new ButtonActionListener(this,"CancelarToolBarProcesoPreciosPorcentaje")); this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jMenuItemCancelarProcesoPreciosPorcentaje.addActionListener (new ButtonActionListener(this,"MenuItemCancelarProcesoPreciosPorcentaje")); this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jMenuItemDetalleCerrarProcesoPreciosPorcentaje.addActionListener (new ButtonActionListener(this,"MenuItemDetalleCerrarProcesoPreciosPorcentaje")); this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jButtonGuardarCambiosToolBarProcesoPreciosPorcentaje.addActionListener (new ButtonActionListener(this,"GuardarCambiosToolBarProcesoPreciosPorcentaje")); this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jButtonGuardarCambiosToolBarProcesoPreciosPorcentaje.addActionListener (new ButtonActionListener(this,"GuardarCambiosToolBarProcesoPreciosPorcentaje")); this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jComboBoxTiposAccionesFormularioProcesoPreciosPorcentaje.addActionListener (new ButtonActionListener(this,"TiposAccionesFormularioProcesoPreciosPorcentaje")); //BUSQUEDA GENERAL this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jButtonidProcesoPreciosPorcentajeBusqueda.addActionListener(new ButtonActionListener(this,"idProcesoPreciosPorcentajeBusqueda")); //ACTUALIZAR FK this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jButtonid_bodegaProcesoPreciosPorcentajeUpdate.addActionListener(new ButtonActionListener(this,"id_bodegaProcesoPreciosPorcentajeUpdate")); //BUSQUEDA GENERAL this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jButtonid_bodegaProcesoPreciosPorcentajeBusqueda.addActionListener(new ButtonActionListener(this,"id_bodegaProcesoPreciosPorcentajeBusqueda")); //ACTUALIZAR FK this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jButtonid_productoProcesoPreciosPorcentajeUpdate.addActionListener(new ButtonActionListener(this,"id_productoProcesoPreciosPorcentajeUpdate")); //BUSQUEDA GENERAL this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jButtonid_productoProcesoPreciosPorcentajeBusqueda.addActionListener(new ButtonActionListener(this,"id_productoProcesoPreciosPorcentajeBusqueda")); //ACTUALIZAR FK this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jButtonid_empresaProcesoPreciosPorcentajeUpdate.addActionListener(new ButtonActionListener(this,"id_empresaProcesoPreciosPorcentajeUpdate")); //BUSQUEDA GENERAL this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jButtonid_empresaProcesoPreciosPorcentajeBusqueda.addActionListener(new ButtonActionListener(this,"id_empresaProcesoPreciosPorcentajeBusqueda")); //ACTUALIZAR FK this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jButtonid_sucursalProcesoPreciosPorcentajeUpdate.addActionListener(new ButtonActionListener(this,"id_sucursalProcesoPreciosPorcentajeUpdate")); //BUSQUEDA GENERAL this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jButtonid_sucursalProcesoPreciosPorcentajeBusqueda.addActionListener(new ButtonActionListener(this,"id_sucursalProcesoPreciosPorcentajeBusqueda")); //ACTUALIZAR FK this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jButtonid_lineaProcesoPreciosPorcentajeUpdate.addActionListener(new ButtonActionListener(this,"id_lineaProcesoPreciosPorcentajeUpdate")); //BUSQUEDA GENERAL this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jButtonid_lineaProcesoPreciosPorcentajeBusqueda.addActionListener(new ButtonActionListener(this,"id_lineaProcesoPreciosPorcentajeBusqueda")); //ACTUALIZAR FK this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jButtonid_linea_grupoProcesoPreciosPorcentajeUpdate.addActionListener(new ButtonActionListener(this,"id_linea_grupoProcesoPreciosPorcentajeUpdate")); //BUSQUEDA GENERAL this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jButtonid_linea_grupoProcesoPreciosPorcentajeBusqueda.addActionListener(new ButtonActionListener(this,"id_linea_grupoProcesoPreciosPorcentajeBusqueda")); //ACTUALIZAR FK this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jButtonid_linea_categoriaProcesoPreciosPorcentajeUpdate.addActionListener(new ButtonActionListener(this,"id_linea_categoriaProcesoPreciosPorcentajeUpdate")); //BUSQUEDA GENERAL this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jButtonid_linea_categoriaProcesoPreciosPorcentajeBusqueda.addActionListener(new ButtonActionListener(this,"id_linea_categoriaProcesoPreciosPorcentajeBusqueda")); //ACTUALIZAR FK this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jButtonid_linea_marcaProcesoPreciosPorcentajeUpdate.addActionListener(new ButtonActionListener(this,"id_linea_marcaProcesoPreciosPorcentajeUpdate")); //BUSQUEDA GENERAL this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jButtonid_linea_marcaProcesoPreciosPorcentajeBusqueda.addActionListener(new ButtonActionListener(this,"id_linea_marcaProcesoPreciosPorcentajeBusqueda")); //BUSQUEDA GENERAL this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jButtoncodigoProcesoPreciosPorcentajeBusqueda.addActionListener(new ButtonActionListener(this,"codigoProcesoPreciosPorcentajeBusqueda")); //BUSQUEDA GENERAL this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jButtonnombreProcesoPreciosPorcentajeBusqueda.addActionListener(new ButtonActionListener(this,"nombreProcesoPreciosPorcentajeBusqueda")); //BUSQUEDA GENERAL this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jButtoncodigo_productoProcesoPreciosPorcentajeBusqueda.addActionListener(new ButtonActionListener(this,"codigo_productoProcesoPreciosPorcentajeBusqueda")); //BUSQUEDA GENERAL this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jButtonnombre_productoProcesoPreciosPorcentajeBusqueda.addActionListener(new ButtonActionListener(this,"nombre_productoProcesoPreciosPorcentajeBusqueda")); //BUSQUEDA GENERAL this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jButtonprecioProcesoPreciosPorcentajeBusqueda.addActionListener(new ButtonActionListener(this,"precioProcesoPreciosPorcentajeBusqueda")); //BUSQUEDA GENERAL this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jButtonporcentajeProcesoPreciosPorcentajeBusqueda.addActionListener(new ButtonActionListener(this,"porcentajeProcesoPreciosPorcentajeBusqueda")); ; //TABBED PANE RELACIONES this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jTabbedPaneRelacionesProcesoPreciosPorcentaje.addChangeListener(new TabbedPaneChangeListener(this,"RelacionesProcesoPreciosPorcentaje")); ; //TABBED PANE RELACIONES FIN(EXTRA TAB) } public void initActions() { this.addInternalFrameListener(new InternalFrameInternalFrameAdapter(this,"CloseInternalFrameProcesoPreciosPorcentaje")); if(this.jInternalFrameDetalleFormProcesoPreciosPorcentaje!=null) { //if(this.conCargarFormDetalle) { this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.addInternalFrameListener(new InternalFrameInternalFrameAdapter(this,"jButtonCancelarProcesoPreciosPorcentaje")); } this.jTableDatosProcesoPreciosPorcentaje.getSelectionModel().addListSelectionListener(new TableListSelectionListener(this,"TableDatosSeleccionarProcesoPreciosPorcentaje")); this.jTableDatosProcesoPreciosPorcentaje.addMouseListener(new TableMouseAdapter(this,"DatosSeleccionarProcesoPreciosPorcentaje")); this.jButtonNuevoProcesoPreciosPorcentaje.addActionListener(new ButtonActionListener(this,"NuevoProcesoPreciosPorcentaje")); this.jButtonDuplicarProcesoPreciosPorcentaje.addActionListener(new ButtonActionListener(this,"DuplicarProcesoPreciosPorcentaje")); this.jButtonCopiarProcesoPreciosPorcentaje.addActionListener(new ButtonActionListener(this,"CopiarProcesoPreciosPorcentaje")); this.jButtonVerFormProcesoPreciosPorcentaje.addActionListener(new ButtonActionListener(this,"VerFormProcesoPreciosPorcentaje")); this.jButtonNuevoToolBarProcesoPreciosPorcentaje.addActionListener(new ButtonActionListener(this,"NuevoToolBarProcesoPreciosPorcentaje")); this.jButtonDuplicarToolBarProcesoPreciosPorcentaje.addActionListener(new ButtonActionListener(this,"DuplicarToolBarProcesoPreciosPorcentaje")); this.jMenuItemNuevoProcesoPreciosPorcentaje.addActionListener (new ButtonActionListener(this,"MenuItemNuevoProcesoPreciosPorcentaje")); this.jMenuItemDuplicarProcesoPreciosPorcentaje.addActionListener (new ButtonActionListener(this,"MenuItemDuplicarProcesoPreciosPorcentaje")); this.jButtonNuevoRelacionesProcesoPreciosPorcentaje.addActionListener (new ButtonActionListener(this,"NuevoRelacionesProcesoPreciosPorcentaje")); this.jButtonNuevoRelacionesToolBarProcesoPreciosPorcentaje.addActionListener(new ButtonActionListener(this,"NuevoRelacionesToolBarProcesoPreciosPorcentaje")); this.jMenuItemNuevoRelacionesProcesoPreciosPorcentaje.addActionListener(new ButtonActionListener(this,"MenuItemNuevoRelacionesProcesoPreciosPorcentaje")); if(this.jInternalFrameDetalleFormProcesoPreciosPorcentaje!=null) { //if(this.conCargarFormDetalle) { this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jButtonModificarProcesoPreciosPorcentaje.addActionListener(new ButtonActionListener(this,"ModificarProcesoPreciosPorcentaje")); } if(this.jInternalFrameDetalleFormProcesoPreciosPorcentaje!=null) { //if(this.conCargarFormDetalle) { this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jButtonModificarToolBarProcesoPreciosPorcentaje.addActionListener(new ButtonActionListener(this,"ModificarToolBarProcesoPreciosPorcentaje")); this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jMenuItemModificarProcesoPreciosPorcentaje.addActionListener(new ButtonActionListener(this,"MenuItemModificarProcesoPreciosPorcentaje")); } if(this.jInternalFrameDetalleFormProcesoPreciosPorcentaje!=null) { //if(this.conCargarFormDetalle) { this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jButtonActualizarProcesoPreciosPorcentaje.addActionListener (new ButtonActionListener(this,"ActualizarProcesoPreciosPorcentaje")); } if(this.jInternalFrameDetalleFormProcesoPreciosPorcentaje!=null) { //if(this.conCargarFormDetalle) { this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jButtonActualizarToolBarProcesoPreciosPorcentaje.addActionListener(new ButtonActionListener(this,"ActualizarToolBarProcesoPreciosPorcentaje")); this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jMenuItemActualizarProcesoPreciosPorcentaje.addActionListener (new ButtonActionListener(this,"MenuItemActualizarProcesoPreciosPorcentaje")); } if(this.jInternalFrameDetalleFormProcesoPreciosPorcentaje!=null) { //if(this.conCargarFormDetalle) { this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jButtonEliminarProcesoPreciosPorcentaje.addActionListener (new ButtonActionListener(this,"EliminarProcesoPreciosPorcentaje")); } if(this.jInternalFrameDetalleFormProcesoPreciosPorcentaje!=null) { //if(this.conCargarFormDetalle) { this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jButtonEliminarToolBarProcesoPreciosPorcentaje.addActionListener (new ButtonActionListener(this,"EliminarToolBarProcesoPreciosPorcentaje")); this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jMenuItemEliminarProcesoPreciosPorcentaje.addActionListener (new ButtonActionListener(this,"MenuItemEliminarProcesoPreciosPorcentaje")); } if(this.jInternalFrameDetalleFormProcesoPreciosPorcentaje!=null) { //if(this.conCargarFormDetalle) { this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jButtonCancelarProcesoPreciosPorcentaje.addActionListener (new ButtonActionListener(this,"CancelarProcesoPreciosPorcentaje")); } if(this.jInternalFrameDetalleFormProcesoPreciosPorcentaje!=null) { //if(this.conCargarFormDetalle) { this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jButtonCancelarToolBarProcesoPreciosPorcentaje.addActionListener (new ButtonActionListener(this,"CancelarToolBarProcesoPreciosPorcentaje")); this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jMenuItemCancelarProcesoPreciosPorcentaje.addActionListener (new ButtonActionListener(this,"MenuItemCancelarProcesoPreciosPorcentaje")); } this.jButtonMostrarOcultarTablaToolBarProcesoPreciosPorcentaje.addActionListener (new ButtonActionListener(this,"MostrarOcultarToolBarProcesoPreciosPorcentaje")); this.jButtonCerrarProcesoPreciosPorcentaje.addActionListener (new ButtonActionListener(this,"CerrarProcesoPreciosPorcentaje")); this.jButtonCerrarToolBarProcesoPreciosPorcentaje.addActionListener (new ButtonActionListener(this,"CerrarToolBarProcesoPreciosPorcentaje")); this.jMenuItemCerrarProcesoPreciosPorcentaje.addActionListener (new ButtonActionListener(this,"MenuItemCerrarProcesoPreciosPorcentaje")); if(this.jInternalFrameDetalleFormProcesoPreciosPorcentaje!=null) { //if(this.conCargarFormDetalle) { this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jMenuItemDetalleCerrarProcesoPreciosPorcentaje.addActionListener (new ButtonActionListener(this,"MenuItemDetalleCerrarProcesoPreciosPorcentaje")); } if(this.jInternalFrameDetalleFormProcesoPreciosPorcentaje!=null) { //if(this.conCargarFormDetalle) { this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jButtonGuardarCambiosProcesoPreciosPorcentaje.addActionListener (new ButtonActionListener(this,"GuardarCambiosProcesoPreciosPorcentaje")); } if(this.jInternalFrameDetalleFormProcesoPreciosPorcentaje!=null) { //if(this.conCargarFormDetalle) { this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jButtonGuardarCambiosToolBarProcesoPreciosPorcentaje.addActionListener (new ButtonActionListener(this,"GuardarCambiosToolBarProcesoPreciosPorcentaje")); } this.jButtonCopiarToolBarProcesoPreciosPorcentaje.addActionListener (new ButtonActionListener(this,"CopiarToolBarProcesoPreciosPorcentaje")); this.jButtonVerFormToolBarProcesoPreciosPorcentaje.addActionListener (new ButtonActionListener(this,"VerFormToolBarProcesoPreciosPorcentaje")); this.jMenuItemGuardarCambiosProcesoPreciosPorcentaje.addActionListener (new ButtonActionListener(this,"MenuItemGuardarCambiosProcesoPreciosPorcentaje")); this.jMenuItemCopiarProcesoPreciosPorcentaje.addActionListener (new ButtonActionListener(this,"MenuItemCopiarProcesoPreciosPorcentaje")); this.jMenuItemVerFormProcesoPreciosPorcentaje.addActionListener (new ButtonActionListener(this,"MenuItemVerFormProcesoPreciosPorcentaje")); this.jButtonGuardarCambiosTablaProcesoPreciosPorcentaje.addActionListener (new ButtonActionListener(this,"GuardarCambiosTablaProcesoPreciosPorcentaje")); this.jButtonGuardarCambiosTablaToolBarProcesoPreciosPorcentaje.addActionListener (new ButtonActionListener(this,"GuardarCambiosTablaToolBarProcesoPreciosPorcentaje")); this.jMenuItemGuardarCambiosTablaProcesoPreciosPorcentaje.addActionListener (new ButtonActionListener(this,"GuardarCambiosTablaProcesoPreciosPorcentaje")); this.jButtonRecargarInformacionProcesoPreciosPorcentaje.addActionListener (new ButtonActionListener(this,"RecargarInformacionProcesoPreciosPorcentaje")); this.jButtonRecargarInformacionToolBarProcesoPreciosPorcentaje.addActionListener (new ButtonActionListener(this,"RecargarInformacionToolBarProcesoPreciosPorcentaje")); this.jMenuItemRecargarInformacionProcesoPreciosPorcentaje.addActionListener (new ButtonActionListener(this,"MenuItemRecargarInformacionProcesoPreciosPorcentaje")); this.jButtonAnterioresProcesoPreciosPorcentaje.addActionListener (new ButtonActionListener(this,"AnterioresProcesoPreciosPorcentaje")); this.jButtonAnterioresToolBarProcesoPreciosPorcentaje.addActionListener (new ButtonActionListener(this,"AnterioresToolBarProcesoPreciosPorcentaje")); this.jMenuItemAnterioresProcesoPreciosPorcentaje.addActionListener (new ButtonActionListener(this,"MenuItemAnterioresProcesoPreciosPorcentaje")); this.jButtonSiguientesProcesoPreciosPorcentaje.addActionListener (new ButtonActionListener(this,"SiguientesProcesoPreciosPorcentaje")); this.jButtonSiguientesToolBarProcesoPreciosPorcentaje.addActionListener (new ButtonActionListener(this,"SiguientesToolBarProcesoPreciosPorcentaje")); this.jMenuItemSiguientesProcesoPreciosPorcentaje.addActionListener (new ButtonActionListener(this,"MenuItemSiguientesProcesoPreciosPorcentaje")); this.jMenuItemAbrirOrderByProcesoPreciosPorcentaje.addActionListener (new ButtonActionListener(this,"MenuItemAbrirOrderByProcesoPreciosPorcentaje")); this.jMenuItemMostrarOcultarProcesoPreciosPorcentaje.addActionListener (new ButtonActionListener(this,"MenuItemMostrarOcultarProcesoPreciosPorcentaje")); this.jMenuItemDetalleAbrirOrderByProcesoPreciosPorcentaje.addActionListener (new ButtonActionListener(this,"MenuItemDetalleAbrirOrderByProcesoPreciosPorcentaje")); this.jMenuItemDetalleMostarOcultarProcesoPreciosPorcentaje.addActionListener (new ButtonActionListener(this,"MenuItemDetalleMostrarOcultarProcesoPreciosPorcentaje")); this.jButtonNuevoGuardarCambiosProcesoPreciosPorcentaje.addActionListener (new ButtonActionListener(this,"NuevoGuardarCambiosProcesoPreciosPorcentaje")); this.jButtonNuevoGuardarCambiosToolBarProcesoPreciosPorcentaje.addActionListener (new ButtonActionListener(this,"NuevoGuardarCambiosToolBarProcesoPreciosPorcentaje")); this.jMenuItemNuevoGuardarCambiosProcesoPreciosPorcentaje.addActionListener (new ButtonActionListener(this,"MenuItemNuevoGuardarCambiosProcesoPreciosPorcentaje")); //SELECCIONAR TODOS this.jCheckBoxSeleccionarTodosProcesoPreciosPorcentaje.addItemListener(new CheckBoxItemListener(this,"SeleccionarTodosProcesoPreciosPorcentaje")); this.jCheckBoxSeleccionadosProcesoPreciosPorcentaje.addItemListener(new CheckBoxItemListener(this,"SeleccionadosProcesoPreciosPorcentaje")); if(this.jInternalFrameDetalleFormProcesoPreciosPorcentaje!=null) { //if(this.conCargarFormDetalle) { this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jComboBoxTiposAccionesFormularioProcesoPreciosPorcentaje.addActionListener (new ButtonActionListener(this,"TiposAccionesFormularioProcesoPreciosPorcentaje")); } this.jComboBoxTiposRelacionesProcesoPreciosPorcentaje.addActionListener (new ButtonActionListener(this,"TiposRelacionesProcesoPreciosPorcentaje")); this.jComboBoxTiposAccionesProcesoPreciosPorcentaje.addActionListener (new ButtonActionListener(this,"TiposAccionesProcesoPreciosPorcentaje")); this.jComboBoxTiposSeleccionarProcesoPreciosPorcentaje.addActionListener (new ButtonActionListener(this,"TiposSeleccionarProcesoPreciosPorcentaje")); this.jTextFieldValorCampoGeneralProcesoPreciosPorcentaje.addActionListener (new ButtonActionListener(this,"ValorCampoGeneralProcesoPreciosPorcentaje")); if(this.jInternalFrameDetalleFormProcesoPreciosPorcentaje!=null) { //if(this.conCargarFormDetalle) { //BUSQUEDA GENERAL this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jButtonidProcesoPreciosPorcentajeBusqueda.addActionListener(new ButtonActionListener(this,"idProcesoPreciosPorcentajeBusqueda")); //ACTUALIZAR FK this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jButtonid_bodegaProcesoPreciosPorcentajeUpdate.addActionListener(new ButtonActionListener(this,"id_bodegaProcesoPreciosPorcentajeUpdate")); //BUSQUEDA GENERAL this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jButtonid_bodegaProcesoPreciosPorcentajeBusqueda.addActionListener(new ButtonActionListener(this,"id_bodegaProcesoPreciosPorcentajeBusqueda")); //ACTUALIZAR FK this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jButtonid_productoProcesoPreciosPorcentajeUpdate.addActionListener(new ButtonActionListener(this,"id_productoProcesoPreciosPorcentajeUpdate")); //BUSQUEDA GENERAL this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jButtonid_productoProcesoPreciosPorcentajeBusqueda.addActionListener(new ButtonActionListener(this,"id_productoProcesoPreciosPorcentajeBusqueda")); //ACTUALIZAR FK this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jButtonid_empresaProcesoPreciosPorcentajeUpdate.addActionListener(new ButtonActionListener(this,"id_empresaProcesoPreciosPorcentajeUpdate")); //BUSQUEDA GENERAL this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jButtonid_empresaProcesoPreciosPorcentajeBusqueda.addActionListener(new ButtonActionListener(this,"id_empresaProcesoPreciosPorcentajeBusqueda")); //ACTUALIZAR FK this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jButtonid_sucursalProcesoPreciosPorcentajeUpdate.addActionListener(new ButtonActionListener(this,"id_sucursalProcesoPreciosPorcentajeUpdate")); //BUSQUEDA GENERAL this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jButtonid_sucursalProcesoPreciosPorcentajeBusqueda.addActionListener(new ButtonActionListener(this,"id_sucursalProcesoPreciosPorcentajeBusqueda")); //ACTUALIZAR FK this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jButtonid_lineaProcesoPreciosPorcentajeUpdate.addActionListener(new ButtonActionListener(this,"id_lineaProcesoPreciosPorcentajeUpdate")); //BUSQUEDA GENERAL this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jButtonid_lineaProcesoPreciosPorcentajeBusqueda.addActionListener(new ButtonActionListener(this,"id_lineaProcesoPreciosPorcentajeBusqueda")); //ACTUALIZAR FK this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jButtonid_linea_grupoProcesoPreciosPorcentajeUpdate.addActionListener(new ButtonActionListener(this,"id_linea_grupoProcesoPreciosPorcentajeUpdate")); //BUSQUEDA GENERAL this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jButtonid_linea_grupoProcesoPreciosPorcentajeBusqueda.addActionListener(new ButtonActionListener(this,"id_linea_grupoProcesoPreciosPorcentajeBusqueda")); //ACTUALIZAR FK this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jButtonid_linea_categoriaProcesoPreciosPorcentajeUpdate.addActionListener(new ButtonActionListener(this,"id_linea_categoriaProcesoPreciosPorcentajeUpdate")); //BUSQUEDA GENERAL this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jButtonid_linea_categoriaProcesoPreciosPorcentajeBusqueda.addActionListener(new ButtonActionListener(this,"id_linea_categoriaProcesoPreciosPorcentajeBusqueda")); //ACTUALIZAR FK this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jButtonid_linea_marcaProcesoPreciosPorcentajeUpdate.addActionListener(new ButtonActionListener(this,"id_linea_marcaProcesoPreciosPorcentajeUpdate")); //BUSQUEDA GENERAL this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jButtonid_linea_marcaProcesoPreciosPorcentajeBusqueda.addActionListener(new ButtonActionListener(this,"id_linea_marcaProcesoPreciosPorcentajeBusqueda")); //BUSQUEDA GENERAL this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jButtoncodigoProcesoPreciosPorcentajeBusqueda.addActionListener(new ButtonActionListener(this,"codigoProcesoPreciosPorcentajeBusqueda")); //BUSQUEDA GENERAL this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jButtonnombreProcesoPreciosPorcentajeBusqueda.addActionListener(new ButtonActionListener(this,"nombreProcesoPreciosPorcentajeBusqueda")); //BUSQUEDA GENERAL this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jButtoncodigo_productoProcesoPreciosPorcentajeBusqueda.addActionListener(new ButtonActionListener(this,"codigo_productoProcesoPreciosPorcentajeBusqueda")); //BUSQUEDA GENERAL this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jButtonnombre_productoProcesoPreciosPorcentajeBusqueda.addActionListener(new ButtonActionListener(this,"nombre_productoProcesoPreciosPorcentajeBusqueda")); //BUSQUEDA GENERAL this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jButtonprecioProcesoPreciosPorcentajeBusqueda.addActionListener(new ButtonActionListener(this,"precioProcesoPreciosPorcentajeBusqueda")); //BUSQUEDA GENERAL this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jButtonporcentajeProcesoPreciosPorcentajeBusqueda.addActionListener(new ButtonActionListener(this,"porcentajeProcesoPreciosPorcentajeBusqueda")); } if(!this.conCargarMinimo) { //BYDAN_BUSQUEDAS this.jButtonBusquedaProcesoPreciosPorcentajeProcesoPreciosPorcentaje.addActionListener(new ButtonActionListener(this,"BusquedaProcesoPreciosPorcentajeProcesoPreciosPorcentaje")); //REPORTE DINAMICO if(this.jInternalFrameReporteDinamicoProcesoPreciosPorcentaje!=null) { this.jInternalFrameReporteDinamicoProcesoPreciosPorcentaje.getjButtonCerrarReporteDinamico().addActionListener (new ButtonActionListener(this,"CerrarReporteDinamicoProcesoPreciosPorcentaje")); this.jInternalFrameReporteDinamicoProcesoPreciosPorcentaje.getjButtonGenerarReporteDinamico().addActionListener (new ButtonActionListener(this,"GenerarReporteDinamicoProcesoPreciosPorcentaje")); this.jInternalFrameReporteDinamicoProcesoPreciosPorcentaje.getjButtonGenerarExcelReporteDinamico().addActionListener (new ButtonActionListener(this,"GenerarExcelReporteDinamicoProcesoPreciosPorcentaje")); } //this.jButtonCerrarReporteDinamicoProcesoPreciosPorcentaje.addActionListener (new ButtonActionListener(this,"CerrarReporteDinamicoProcesoPreciosPorcentaje")); //this.jButtonGenerarReporteDinamicoProcesoPreciosPorcentaje.addActionListener (new ButtonActionListener(this,"GenerarReporteDinamicoProcesoPreciosPorcentaje")); //this.jButtonGenerarExcelReporteDinamicoProcesoPreciosPorcentaje.addActionListener (new ButtonActionListener(this,"GenerarExcelReporteDinamicoProcesoPreciosPorcentaje")); //IMPORTACION if(this.jInternalFrameImportacionProcesoPreciosPorcentaje!=null) { this.jInternalFrameImportacionProcesoPreciosPorcentaje.getjButtonCerrarImportacion().addActionListener (new ButtonActionListener(this,"CerrarImportacionProcesoPreciosPorcentaje")); this.jInternalFrameImportacionProcesoPreciosPorcentaje.getjButtonGenerarImportacion().addActionListener (new ButtonActionListener(this,"GenerarImportacionProcesoPreciosPorcentaje")); this.jInternalFrameImportacionProcesoPreciosPorcentaje.getjButtonAbrirImportacion().addActionListener (new ButtonActionListener(this,"AbrirImportacionProcesoPreciosPorcentaje")); } //ORDER BY this.jButtonAbrirOrderByProcesoPreciosPorcentaje.addActionListener (new ButtonActionListener(this,"AbrirOrderByProcesoPreciosPorcentaje")); this.jButtonAbrirOrderByToolBarProcesoPreciosPorcentaje.addActionListener (new ButtonActionListener(this,"AbrirOrderByToolBarProcesoPreciosPorcentaje")); if(this.jInternalFrameOrderByProcesoPreciosPorcentaje!=null) { this.jInternalFrameOrderByProcesoPreciosPorcentaje.getjButtonCerrarOrderBy().addActionListener (new ButtonActionListener(this,"CerrarOrderByProcesoPreciosPorcentaje")); } } if(!this.conCargarMinimo) { if(this.jInternalFrameDetalleFormProcesoPreciosPorcentaje!=null) { //if(this.conCargarFormDetalle) { ; } } //TABBED PANE RELACIONES if(this.jInternalFrameDetalleFormProcesoPreciosPorcentaje!=null) { //if(this.conCargarFormDetalle) { this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jTabbedPaneRelacionesProcesoPreciosPorcentaje.addChangeListener(new TabbedPaneChangeListener(this,"RelacionesProcesoPreciosPorcentaje")); ; } //TABBED PANE RELACIONES FIN(EXTRA TAB) } /* public void initActions() { String sMapKey = ""; InputMap inputMap =null; this.addInternalFrameListener(new javax.swing.event.InternalFrameAdapter() { public void internalFrameClosing(InternalFrameEvent event) { try { closingInternalFrameProcesoPreciosPorcentaje(); } catch (Exception e) { e.printStackTrace(); } } }); this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.addInternalFrameListener(new javax.swing.event.InternalFrameAdapter() { public void internalFrameClosing(InternalFrameEvent event) { JInternalFrameBase jInternalFrameDetalleFormProcesoPreciosPorcentaje = (JInternalFrameBase)event.getSource(); ProcesoPreciosPorcentajeBeanSwingJInternalFrame jInternalFrameParent=(ProcesoPreciosPorcentajeBeanSwingJInternalFrame)jInternalFrameDetalleFormProcesoPreciosPorcentaje.getjInternalFrameParent(); try { jInternalFrameParent.jButtonCancelarProcesoPreciosPorcentajeActionPerformed(null); //jInternalFrameParent.dispose(); //jInternalFrameParent=null; } catch (Exception e) { e.printStackTrace(); } } }); this.jTableDatosProcesoPreciosPorcentaje.getSelectionModel().addListSelectionListener ( new ListSelectionListener() { public void valueChanged(ListSelectionEvent e) { //BYDAN_DESHABILITADO //try {jTableDatosProcesoPreciosPorcentajeListSelectionListener(e);}catch(Exception e1){e1.printStackTrace();} } } ); this.jTableDatosProcesoPreciosPorcentaje.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent evt) { if (evt.getClickCount() == 2) { jButtonIdActionPerformed(null,jTableDatosProcesoPreciosPorcentaje.getSelectedRow(),false,false); } } }); this.jButtonNuevoProcesoPreciosPorcentaje.addActionListener ( new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent evt) { try {jButtonNuevoProcesoPreciosPorcentajeActionPerformed(evt,false);}catch(Exception e){e.printStackTrace();} } } ); this.jButtonNuevoToolBarProcesoPreciosPorcentaje.addActionListener ( new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent evt) { try {jButtonNuevoProcesoPreciosPorcentajeActionPerformed(evt,false);}catch(Exception e){e.printStackTrace();} } } ); this.jMenuItemNuevoProcesoPreciosPorcentaje.addActionListener ( new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent evt) { try {jButtonNuevoProcesoPreciosPorcentajeActionPerformed(evt,false);}catch(Exception e){e.printStackTrace();} } } ); sMapKey = "NuevoProcesoPreciosPorcentaje"; inputMap = this.jButtonNuevoProcesoPreciosPorcentaje.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW); inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_N , KeyEvent.CTRL_MASK), sMapKey); this.jButtonNuevoProcesoPreciosPorcentaje.getActionMap().put(sMapKey, new AbstractAction() { public static final long serialVersionUID = 1L; public void actionPerformed(ActionEvent evt) { try {jButtonNuevoProcesoPreciosPorcentajeActionPerformed(evt,false);} catch (Exception e) {e.printStackTrace();} } }); this.jButtonNuevoRelacionesProcesoPreciosPorcentaje.addActionListener ( new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent evt) { try {jButtonNuevoProcesoPreciosPorcentajeActionPerformed(evt,true);}catch(Exception e){e.printStackTrace();} } } ); this.jButtonNuevoRelacionesToolBarProcesoPreciosPorcentaje.addActionListener ( new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent evt) { try {jButtonNuevoProcesoPreciosPorcentajeActionPerformed(evt,true);}catch(Exception e){e.printStackTrace();} } } ); this.jMenuItemNuevoRelacionesProcesoPreciosPorcentaje.addActionListener ( new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent evt) { try {jButtonNuevoProcesoPreciosPorcentajeActionPerformed(evt,true);}catch(Exception e){e.printStackTrace();} } } ); sMapKey = "NuevoRelacionesProcesoPreciosPorcentaje"; inputMap = this.jButtonNuevoRelacionesProcesoPreciosPorcentaje.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW); inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_R , KeyEvent.CTRL_MASK), sMapKey); this.jButtonNuevoRelacionesProcesoPreciosPorcentaje.getActionMap().put(sMapKey, new AbstractAction() { public static final long serialVersionUID = 1L; public void actionPerformed(ActionEvent evt) { try {jButtonNuevoProcesoPreciosPorcentajeActionPerformed(evt,true);} catch (Exception e) {e.printStackTrace();} } }); this.jButtonModificarProcesoPreciosPorcentaje.addActionListener ( new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent evt) { try {jButtonModificarProcesoPreciosPorcentajeActionPerformed(evt);}catch(Exception e){e.printStackTrace();} } } ); this.jButtonModificarToolBarProcesoPreciosPorcentaje.addActionListener ( new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent evt) { try {jButtonModificarProcesoPreciosPorcentajeActionPerformed(evt);}catch(Exception e){e.printStackTrace();} } } ); this.jMenuItemModificarProcesoPreciosPorcentaje.addActionListener ( new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent evt) { try {jButtonModificarProcesoPreciosPorcentajeActionPerformed(evt);}catch(Exception e){e.printStackTrace();} } } ); sMapKey = "ModificarProcesoPreciosPorcentaje"; inputMap = this.jButtonModificarProcesoPreciosPorcentaje.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW); inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_M , KeyEvent.CTRL_MASK), sMapKey); this.jButtonModificarProcesoPreciosPorcentaje.getActionMap().put(sMapKey, new AbstractAction() { public static final long serialVersionUID = 1L; public void actionPerformed(ActionEvent evt) { try {jButtonModificarProcesoPreciosPorcentajeActionPerformed(evt);} catch (Exception e) {e.printStackTrace();} } }); this.jButtonActualizarProcesoPreciosPorcentaje.addActionListener ( new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent evt) { try {jButtonActualizarProcesoPreciosPorcentajeActionPerformed(evt);}catch(Exception e){e.printStackTrace();} } } ); this.jButtonActualizarToolBarProcesoPreciosPorcentaje.addActionListener ( new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent evt) { try {jButtonActualizarProcesoPreciosPorcentajeActionPerformed(evt);}catch(Exception e){e.printStackTrace();} } } ); this.jMenuItemActualizarProcesoPreciosPorcentaje.addActionListener ( new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent evt) { try {jButtonActualizarProcesoPreciosPorcentajeActionPerformed(evt);}catch(Exception e){e.printStackTrace();} } } ); sMapKey = "ActualizarProcesoPreciosPorcentaje"; inputMap = this.jButtonActualizarProcesoPreciosPorcentaje.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW); inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_G , KeyEvent.CTRL_MASK), sMapKey); this.jButtonActualizarProcesoPreciosPorcentaje.getActionMap().put(sMapKey, new AbstractAction() { public static final long serialVersionUID = 1L; public void actionPerformed(ActionEvent evt) { try {jButtonActualizarProcesoPreciosPorcentajeActionPerformed(evt);} catch (Exception e) {e.printStackTrace();} } }); this.jButtonEliminarProcesoPreciosPorcentaje.addActionListener ( new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent evt) { try {jButtonEliminarProcesoPreciosPorcentajeActionPerformed(evt);}catch(Exception e){e.printStackTrace();} } } ); this.jButtonEliminarToolBarProcesoPreciosPorcentaje.addActionListener ( new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent evt) { try {jButtonEliminarProcesoPreciosPorcentajeActionPerformed(evt);}catch(Exception e){e.printStackTrace();} } } ); this.jMenuItemEliminarProcesoPreciosPorcentaje.addActionListener ( new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent evt) { try {jButtonEliminarProcesoPreciosPorcentajeActionPerformed(evt);}catch(Exception e){e.printStackTrace();} } } ); sMapKey = "EliminarProcesoPreciosPorcentaje"; inputMap = this.jButtonEliminarProcesoPreciosPorcentaje.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW); inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_E , KeyEvent.CTRL_MASK), sMapKey); this.jButtonEliminarProcesoPreciosPorcentaje.getActionMap().put(sMapKey, new AbstractAction() { public static final long serialVersionUID = 1L; public void actionPerformed(ActionEvent evt) { try {jButtonEliminarProcesoPreciosPorcentajeActionPerformed(evt);} catch (Exception e) {e.printStackTrace();} } }); this.jButtonCancelarProcesoPreciosPorcentaje.addActionListener ( new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent evt) { try {jButtonCancelarProcesoPreciosPorcentajeActionPerformed(evt);}catch(Exception e){e.printStackTrace();} } } ); this.jButtonCancelarToolBarProcesoPreciosPorcentaje.addActionListener ( new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent evt) { try {jButtonCancelarProcesoPreciosPorcentajeActionPerformed(evt);}catch(Exception e){e.printStackTrace();} } } ); this.jMenuItemCancelarProcesoPreciosPorcentaje.addActionListener ( new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent evt) { try {jButtonCancelarProcesoPreciosPorcentajeActionPerformed(evt);}catch(Exception e){e.printStackTrace();} } } ); sMapKey = "CancelarProcesoPreciosPorcentaje"; inputMap = this.jButtonCancelarProcesoPreciosPorcentaje.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW); inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_Q , KeyEvent.CTRL_MASK), sMapKey); this.jButtonCancelarProcesoPreciosPorcentaje.getActionMap().put(sMapKey, new AbstractAction() { public static final long serialVersionUID = 1L; public void actionPerformed(ActionEvent evt) { try {jButtonCancelarProcesoPreciosPorcentajeActionPerformed(evt);} catch (Exception e) {e.printStackTrace();} } }); this.jButtonCerrarProcesoPreciosPorcentaje.addActionListener ( new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent evt) { try {jButtonCerrarProcesoPreciosPorcentajeActionPerformed(evt);}catch(Exception e){e.printStackTrace();} } } ); this.jButtonCerrarToolBarProcesoPreciosPorcentaje.addActionListener ( new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent evt) { try {jButtonCerrarProcesoPreciosPorcentajeActionPerformed(evt);}catch(Exception e){e.printStackTrace();} } } ); this.jMenuItemCerrarProcesoPreciosPorcentaje.addActionListener ( new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent evt) { try {jButtonCerrarProcesoPreciosPorcentajeActionPerformed(evt);}catch(Exception e){e.printStackTrace();} } } ); this.jMenuItemDetalleCerrarProcesoPreciosPorcentaje.addActionListener ( new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent evt) { //try {jButtonCerrarProcesoPreciosPorcentajeActionPerformed(evt);}catch(Exception e){e.printStackTrace();} try {jButtonCancelarProcesoPreciosPorcentajeActionPerformed(evt);}catch(Exception e){e.printStackTrace();} } } ); sMapKey = "CerrarProcesoPreciosPorcentaje"; inputMap = this.jButtonCerrarProcesoPreciosPorcentaje.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW); inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_C , KeyEvent.ALT_MASK), sMapKey); this.jButtonCerrarProcesoPreciosPorcentaje.getActionMap().put(sMapKey, new AbstractAction() { public static final long serialVersionUID = 1L; public void actionPerformed(ActionEvent evt) { try {jButtonCerrarProcesoPreciosPorcentajeActionPerformed(evt);} catch (Exception e) {e.printStackTrace();} } }); this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jButtonGuardarCambiosProcesoPreciosPorcentaje.addActionListener ( new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent evt) { try {jButtonGuardarCambiosProcesoPreciosPorcentajeActionPerformed(evt);}catch(Exception e){e.printStackTrace();} } } ); this.jButtonGuardarCambiosToolBarProcesoPreciosPorcentaje.addActionListener ( new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent evt) { try {jButtonGuardarCambiosProcesoPreciosPorcentajeActionPerformed(evt);}catch(Exception e){e.printStackTrace();} } } ); this.jMenuItemGuardarCambiosProcesoPreciosPorcentaje.addActionListener ( new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent evt) { try {jButtonGuardarCambiosProcesoPreciosPorcentajeActionPerformed(evt);}catch(Exception e){e.printStackTrace();} } } ); this.jButtonGuardarCambiosTablaProcesoPreciosPorcentaje.addActionListener ( new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent evt) { try {jButtonGuardarCambiosProcesoPreciosPorcentajeActionPerformed(evt);}catch(Exception e){e.printStackTrace();} } } ); this.jButtonGuardarCambiosTablaToolBarProcesoPreciosPorcentaje.addActionListener ( new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent evt) { try {jButtonGuardarCambiosProcesoPreciosPorcentajeActionPerformed(evt);}catch(Exception e){e.printStackTrace();} } } ); this.jMenuItemGuardarCambiosTablaProcesoPreciosPorcentaje.addActionListener ( new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent evt) { try {jButtonGuardarCambiosProcesoPreciosPorcentajeActionPerformed(evt);}catch(Exception e){e.printStackTrace();} } } ); sMapKey = "GuardarCambiosProcesoPreciosPorcentaje"; inputMap = this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jButtonGuardarCambiosProcesoPreciosPorcentaje.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW); inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_G , KeyEvent.CTRL_MASK), sMapKey); this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jButtonGuardarCambiosProcesoPreciosPorcentaje.getActionMap().put(sMapKey, new AbstractAction() { public static final long serialVersionUID = 1L; public void actionPerformed(ActionEvent evt) { try {jButtonGuardarCambiosProcesoPreciosPorcentajeActionPerformed(evt);} catch (Exception e) {e.printStackTrace();} } }); this.jButtonRecargarInformacionProcesoPreciosPorcentaje.addActionListener ( new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent evt) { try {jButtonRecargarInformacionProcesoPreciosPorcentajeActionPerformed(evt);}catch(Exception e){e.printStackTrace();} } } ); this.jButtonRecargarInformacionToolBarProcesoPreciosPorcentaje.addActionListener ( new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent evt) { try {jButtonRecargarInformacionProcesoPreciosPorcentajeActionPerformed(evt);}catch(Exception e){e.printStackTrace();} } } ); this.jMenuItemRecargarInformacionProcesoPreciosPorcentaje.addActionListener ( new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent evt) { try {jButtonRecargarInformacionProcesoPreciosPorcentajeActionPerformed(evt);}catch(Exception e){e.printStackTrace();} } } ); this.jButtonAnterioresProcesoPreciosPorcentaje.addActionListener ( new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent evt) { try {jButtonAnterioresProcesoPreciosPorcentajeActionPerformed(evt);}catch(Exception e){e.printStackTrace();} } } ); this.jButtonAnterioresToolBarProcesoPreciosPorcentaje.addActionListener ( new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent evt) { try {jButtonAnterioresProcesoPreciosPorcentajeActionPerformed(evt);}catch(Exception e){e.printStackTrace();} } } ); this.jMenuItemAnterioresProcesoPreciosPorcentaje.addActionListener ( new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent evt) { try {jButtonAnterioresProcesoPreciosPorcentajeActionPerformed(evt);}catch(Exception e){e.printStackTrace();} } } ); this.jButtonSiguientesProcesoPreciosPorcentaje.addActionListener ( new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent evt) { try {jButtonSiguientesProcesoPreciosPorcentajeActionPerformed(evt);}catch(Exception e){e.printStackTrace();} } } ); this.jButtonSiguientesToolBarProcesoPreciosPorcentaje.addActionListener ( new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent evt) { try {jButtonSiguientesProcesoPreciosPorcentajeActionPerformed(evt);}catch(Exception e){e.printStackTrace();} } } ); this.jMenuItemSiguientesProcesoPreciosPorcentaje.addActionListener ( new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent evt) { try {jButtonSiguientesProcesoPreciosPorcentajeActionPerformed(evt);}catch(Exception e){e.printStackTrace();} } } ); this.jButtonNuevoGuardarCambiosProcesoPreciosPorcentaje.addActionListener ( new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent evt) { try {jButtonNuevoGuardarCambiosProcesoPreciosPorcentajeActionPerformed(evt);}catch(Exception e){e.printStackTrace();} } } ); this.jButtonNuevoGuardarCambiosToolBarProcesoPreciosPorcentaje.addActionListener ( new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent evt) { try {jButtonNuevoGuardarCambiosProcesoPreciosPorcentajeActionPerformed(evt);}catch(Exception e){e.printStackTrace();} } } ); this.jMenuItemNuevoGuardarCambiosProcesoPreciosPorcentaje.addActionListener ( new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent evt) { try {jButtonNuevoGuardarCambiosProcesoPreciosPorcentajeActionPerformed(evt);}catch(Exception e){e.printStackTrace();} } } ); //SELECCIONAR TODOS this.jCheckBoxSeleccionarTodosProcesoPreciosPorcentaje.addItemListener(new ItemListener() { public void itemStateChanged(ItemEvent evt) { try {jCheckBoxSeleccionarTodosProcesoPreciosPorcentajeItemListener(evt);}catch(Exception e){e.printStackTrace();} } }); this.jComboBoxTiposAccionesProcesoPreciosPorcentaje.addActionListener (new ActionListener () { public void actionPerformed(ActionEvent e) { try {jComboBoxTiposAccionesProcesoPreciosPorcentajeActionListener(e);} catch (Exception e1) { e1.printStackTrace();} }; }); this.jComboBoxTiposSeleccionarProcesoPreciosPorcentaje.addActionListener (new ActionListener () { public void actionPerformed(ActionEvent e) { try {jComboBoxTiposSeleccionarProcesoPreciosPorcentajeActionListener(e);} catch (Exception e1) { e1.printStackTrace();} }; }); this.jTextFieldValorCampoGeneralProcesoPreciosPorcentaje.addActionListener (new ActionListener () { public void actionPerformed(ActionEvent e) { try {jTextFieldValorCampoGeneralProcesoPreciosPorcentajeActionListener(e);} catch (Exception e1) { e1.printStackTrace();} }; }); //BUSQUEDA GENERAL this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jButtonidProcesoPreciosPorcentajeBusqueda.addActionListener(new ButtonActionListener(this,"idProcesoPreciosPorcentajeBusqueda")); //ACTUALIZAR FK this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jButtonid_bodegaProcesoPreciosPorcentajeUpdate.addActionListener(new ButtonActionListener(this,"id_bodegaProcesoPreciosPorcentajeUpdate")); //BUSQUEDA GENERAL this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jButtonid_bodegaProcesoPreciosPorcentajeBusqueda.addActionListener(new ButtonActionListener(this,"id_bodegaProcesoPreciosPorcentajeBusqueda")); //ACTUALIZAR FK this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jButtonid_productoProcesoPreciosPorcentajeUpdate.addActionListener(new ButtonActionListener(this,"id_productoProcesoPreciosPorcentajeUpdate")); //BUSQUEDA GENERAL this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jButtonid_productoProcesoPreciosPorcentajeBusqueda.addActionListener(new ButtonActionListener(this,"id_productoProcesoPreciosPorcentajeBusqueda")); //ACTUALIZAR FK this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jButtonid_empresaProcesoPreciosPorcentajeUpdate.addActionListener(new ButtonActionListener(this,"id_empresaProcesoPreciosPorcentajeUpdate")); //BUSQUEDA GENERAL this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jButtonid_empresaProcesoPreciosPorcentajeBusqueda.addActionListener(new ButtonActionListener(this,"id_empresaProcesoPreciosPorcentajeBusqueda")); //ACTUALIZAR FK this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jButtonid_sucursalProcesoPreciosPorcentajeUpdate.addActionListener(new ButtonActionListener(this,"id_sucursalProcesoPreciosPorcentajeUpdate")); //BUSQUEDA GENERAL this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jButtonid_sucursalProcesoPreciosPorcentajeBusqueda.addActionListener(new ButtonActionListener(this,"id_sucursalProcesoPreciosPorcentajeBusqueda")); //ACTUALIZAR FK this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jButtonid_lineaProcesoPreciosPorcentajeUpdate.addActionListener(new ButtonActionListener(this,"id_lineaProcesoPreciosPorcentajeUpdate")); //BUSQUEDA GENERAL this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jButtonid_lineaProcesoPreciosPorcentajeBusqueda.addActionListener(new ButtonActionListener(this,"id_lineaProcesoPreciosPorcentajeBusqueda")); //ACTUALIZAR FK this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jButtonid_linea_grupoProcesoPreciosPorcentajeUpdate.addActionListener(new ButtonActionListener(this,"id_linea_grupoProcesoPreciosPorcentajeUpdate")); //BUSQUEDA GENERAL this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jButtonid_linea_grupoProcesoPreciosPorcentajeBusqueda.addActionListener(new ButtonActionListener(this,"id_linea_grupoProcesoPreciosPorcentajeBusqueda")); //ACTUALIZAR FK this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jButtonid_linea_categoriaProcesoPreciosPorcentajeUpdate.addActionListener(new ButtonActionListener(this,"id_linea_categoriaProcesoPreciosPorcentajeUpdate")); //BUSQUEDA GENERAL this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jButtonid_linea_categoriaProcesoPreciosPorcentajeBusqueda.addActionListener(new ButtonActionListener(this,"id_linea_categoriaProcesoPreciosPorcentajeBusqueda")); //ACTUALIZAR FK this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jButtonid_linea_marcaProcesoPreciosPorcentajeUpdate.addActionListener(new ButtonActionListener(this,"id_linea_marcaProcesoPreciosPorcentajeUpdate")); //BUSQUEDA GENERAL this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jButtonid_linea_marcaProcesoPreciosPorcentajeBusqueda.addActionListener(new ButtonActionListener(this,"id_linea_marcaProcesoPreciosPorcentajeBusqueda")); //BUSQUEDA GENERAL this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jButtoncodigoProcesoPreciosPorcentajeBusqueda.addActionListener(new ButtonActionListener(this,"codigoProcesoPreciosPorcentajeBusqueda")); //BUSQUEDA GENERAL this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jButtonnombreProcesoPreciosPorcentajeBusqueda.addActionListener(new ButtonActionListener(this,"nombreProcesoPreciosPorcentajeBusqueda")); //BUSQUEDA GENERAL this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jButtoncodigo_productoProcesoPreciosPorcentajeBusqueda.addActionListener(new ButtonActionListener(this,"codigo_productoProcesoPreciosPorcentajeBusqueda")); //BUSQUEDA GENERAL this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jButtonnombre_productoProcesoPreciosPorcentajeBusqueda.addActionListener(new ButtonActionListener(this,"nombre_productoProcesoPreciosPorcentajeBusqueda")); //BUSQUEDA GENERAL this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jButtonprecioProcesoPreciosPorcentajeBusqueda.addActionListener(new ButtonActionListener(this,"precioProcesoPreciosPorcentajeBusqueda")); //BUSQUEDA GENERAL this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jButtonporcentajeProcesoPreciosPorcentajeBusqueda.addActionListener(new ButtonActionListener(this,"porcentajeProcesoPreciosPorcentajeBusqueda")); this.jButtonBusquedaProcesoPreciosPorcentajeProcesoPreciosPorcentaje.addActionListener(new ButtonActionListener(this,"BusquedaProcesoPreciosPorcentajeProcesoPreciosPorcentaje")); //REPORTE DINAMICO this.jButtonCerrarReporteDinamicoProcesoPreciosPorcentaje.addActionListener ( new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent evt) { try {jButtonCerrarReporteDinamicoProcesoPreciosPorcentajeActionPerformed(evt);}catch(Exception e){e.printStackTrace();} } } ); this.jButtonGenerarReporteDinamicoProcesoPreciosPorcentaje.addActionListener ( new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent evt) { try {jButtonGenerarReporteDinamicoProcesoPreciosPorcentajeActionPerformed(evt);}catch(Exception e){e.printStackTrace();} } } ); this.jButtonGenerarExcelReporteDinamicoProcesoPreciosPorcentaje.addActionListener ( new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent evt) { try {jButtonGenerarExcelReporteDinamicoProcesoPreciosPorcentajeActionPerformed(evt);}catch(Exception e){e.printStackTrace();} } } ); //IMPORTACION this.jButtonCerrarImportacionProcesoPreciosPorcentaje.addActionListener ( new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent evt) { try {jButtonCerrarImportacionProcesoPreciosPorcentajeActionPerformed(evt);}catch(Exception e){e.printStackTrace();} } } ); this.jButtonGenerarImportacionProcesoPreciosPorcentaje.addActionListener ( new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent evt) { try {jButtonGenerarImportacionProcesoPreciosPorcentajeActionPerformed(evt);}catch(Exception e){e.printStackTrace();} } } ); this.jButtonAbrirImportacionProcesoPreciosPorcentaje.addActionListener ( new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent evt) { try {jButtonAbrirImportacionProcesoPreciosPorcentajeActionPerformed(evt);}catch(Exception e){e.printStackTrace();} } } ); } */ public void jComboBoxTiposSeleccionarProcesoPreciosPorcentajeActionListener(ActionEvent evt) throws Exception { try { Reporte reporte=(Reporte)this.jComboBoxTiposSeleccionarProcesoPreciosPorcentaje.getSelectedItem(); //if(reporte.getsCodigo().equals("SELECCIONAR")) { //} } catch(Exception e) { FuncionesSwing.manageException(this, e,logger,ProcesoPreciosPorcentajeConstantesFunciones.CLASSNAME); } } public void seleccionarTodosProcesoPreciosPorcentaje(Boolean conSeleccionarTodos) throws Exception { try { if(Constantes.ISUSAEJBLOGICLAYER) { for(ProcesoPreciosPorcentaje procesopreciosporcentajeAux:this.procesopreciosporcentajeLogic.getProcesoPreciosPorcentajes()) { procesopreciosporcentajeAux.setIsSelected(conSeleccionarTodos); } } else if(Constantes.ISUSAEJBREMOTE||Constantes.ISUSAEJBHOME) { for(ProcesoPreciosPorcentaje procesopreciosporcentajeAux:procesopreciosporcentajes) { procesopreciosporcentajeAux.setIsSelected(conSeleccionarTodos); } } } catch(Exception e) { FuncionesSwing.manageException(this, e,logger,ProcesoPreciosPorcentajeConstantesFunciones.CLASSNAME); } } public void jCheckBoxSeleccionarTodosProcesoPreciosPorcentajeItemListener(ItemEvent evt) throws Exception { try { this.inicializarActualizarBindingProcesoPreciosPorcentaje(false,false); //JCheckBox jCheckBox=(JCheckBox)evt.getSource(); //System.out.println("ok"); Boolean existe=false; if(sTipoSeleccionar.equals("COLUMNAS")) { existe=true; if(Constantes.ISUSAEJBLOGICLAYER) { for(ProcesoPreciosPorcentaje procesopreciosporcentajeAux:this.procesopreciosporcentajeLogic.getProcesoPreciosPorcentajes()) { procesopreciosporcentajeAux.setIsSelected(this.isSeleccionarTodos); } } else if(Constantes.ISUSAEJBREMOTE||Constantes.ISUSAEJBHOME) { for(ProcesoPreciosPorcentaje procesopreciosporcentajeAux:procesopreciosporcentajes) { procesopreciosporcentajeAux.setIsSelected(this.isSeleccionarTodos); } } } else { if(Constantes.ISUSAEJBLOGICLAYER) { for(ProcesoPreciosPorcentaje procesopreciosporcentajeAux:this.procesopreciosporcentajeLogic.getProcesoPreciosPorcentajes()) { } } else if(Constantes.ISUSAEJBREMOTE||Constantes.ISUSAEJBHOME) { for(ProcesoPreciosPorcentaje procesopreciosporcentajeAux:procesopreciosporcentajes) { } } } if(existe) { this.inicializarActualizarBindingTablaProcesoPreciosPorcentaje(false); } else { JOptionPane.showMessageDialog(this,"NO SE HA SELECCIONADO ALGUNA COLUMNA VALIDA","SELECCIONAR",JOptionPane.ERROR_MESSAGE); } //TableCellRenderer tableCellRenderer=null; //TableCellEditor tableCellEditor=null; //FUNCIONA CON MODEL PERO SE DANA MANTENIMIENTO /* for(int i = 0; i < this.jTableDatosProcesoPreciosPorcentaje.getRowCount(); i++) { tableCellRenderer=this.jTableDatosSistema.getCellRenderer(i, 2); tableCellEditor=this.jTableDatosSistema.getCellEditor(i, 2); idSeleccionarTableCell=(IdSeleccionarTableCell)tableCellRenderer; idSeleccionarTableCell.jCheckBoxId.setSelected(jCheckBox.isSelected()); idSeleccionarTableCell=(IdSeleccionarTableCell)tableCellEditor; if(idSeleccionarTableCell.jCheckBoxId!=null) { idSeleccionarTableCell.jCheckBoxId.setSelected(jCheckBox.isSelected()); } //System.out.println(idSeleccionarTableCell.valor); //this.jTableDatosProcesoPreciosPorcentaje.getModel().setValueAt(jCheckBox.isSelected(), i, Funciones2.getColumnIndexByName(this.jTableDatosProcesoPreciosPorcentaje,Constantes2.S_SELECCIONAR)); } */ } catch(Exception e) { FuncionesSwing.manageException(this, e,logger,ProcesoPreciosPorcentajeConstantesFunciones.CLASSNAME); } } public void jCheckBoxSeleccionadosProcesoPreciosPorcentajeItemListener(ItemEvent evt) throws Exception { try { this.inicializarActualizarBindingProcesoPreciosPorcentaje(false,false); //JCheckBox jCheckBox=(JCheckBox)evt.getSource(); //System.out.println("ok"); Boolean existe=false; int[] arrNumRowsSeleccionados=null; arrNumRowsSeleccionados=this.jTableDatosProcesoPreciosPorcentaje.getSelectedRows(); ProcesoPreciosPorcentaje procesopreciosporcentajeLocal=new ProcesoPreciosPorcentaje(); //this.seleccionarTodosProcesoPreciosPorcentaje(false); for(Integer iNumRowSeleccionado:arrNumRowsSeleccionados) { existe=true; if(Constantes.ISUSAEJBLOGICLAYER) { procesopreciosporcentajeLocal =(ProcesoPreciosPorcentaje) this.procesopreciosporcentajeLogic.getProcesoPreciosPorcentajes().toArray()[this.jTableDatosProcesoPreciosPorcentaje.convertRowIndexToModel(iNumRowSeleccionado)]; } else if(Constantes.ISUSAEJBREMOTE || Constantes.ISUSAEJBHOME) { procesopreciosporcentajeLocal =(ProcesoPreciosPorcentaje) this.procesopreciosporcentajes.toArray()[this.jTableDatosProcesoPreciosPorcentaje.convertRowIndexToModel(iNumRowSeleccionado)]; } procesopreciosporcentajeLocal.setIsSelected(this.isSeleccionados); } /* if(sTipoSeleccionar.equals("SELECCIONAR")) { existe=true; if(Constantes.ISUSAEJBLOGICLAYER) { for(ProcesoPreciosPorcentaje procesopreciosporcentajeAux:this.procesopreciosporcentajeLogic.getProcesoPreciosPorcentajes()) { procesopreciosporcentajeAux.setIsSelected(this.isSeleccionados); } } else if(Constantes.ISUSAEJBREMOTE||Constantes.ISUSAEJBHOME) { for(ProcesoPreciosPorcentaje procesopreciosporcentajeAux:procesopreciosporcentajes) { procesopreciosporcentajeAux.setIsSelected(this.isSeleccionados); } } } */ //if(existe) { this.inicializarActualizarBindingTablaProcesoPreciosPorcentaje(false); /* } else { JOptionPane.showMessageDialog(this,"NO SE HA SELECCIONADO ALGUNA COLUMNA VALIDA","SELECCIONAR",JOptionPane.ERROR_MESSAGE); } */ //TableCellRenderer tableCellRenderer=null; //TableCellEditor tableCellEditor=null; //FUNCIONA CON MODEL PERO SE DANA MANTENIMIENTO /* for(int i = 0; i < this.jTableDatosProcesoPreciosPorcentaje.getRowCount(); i++) { tableCellRenderer=this.jTableDatosSistema.getCellRenderer(i, 2); tableCellEditor=this.jTableDatosSistema.getCellEditor(i, 2); idSeleccionarTableCell=(IdSeleccionarTableCell)tableCellRenderer; idSeleccionarTableCell.jCheckBoxId.setSelected(jCheckBox.isSelected()); idSeleccionarTableCell=(IdSeleccionarTableCell)tableCellEditor; if(idSeleccionarTableCell.jCheckBoxId!=null) { idSeleccionarTableCell.jCheckBoxId.setSelected(jCheckBox.isSelected()); } //System.out.println(idSeleccionarTableCell.valor); //this.jTableDatosProcesoPreciosPorcentaje.getModel().setValueAt(jCheckBox.isSelected(), i, Funciones2.getColumnIndexByName(this.jTableDatosProcesoPreciosPorcentaje,Constantes2.S_SELECCIONAR)); } */ } catch(Exception e) { FuncionesSwing.manageException(this, e,logger,ProcesoPreciosPorcentajeConstantesFunciones.CLASSNAME); } } public void jCheckBoxSeleccionarActualProcesoPreciosPorcentajeItemListener(ItemEvent evt,Long idActual) throws Exception { try { } catch(Exception e) { FuncionesSwing.manageException(this, e,logger,ProcesoPreciosPorcentajeConstantesFunciones.CLASSNAME); } } public void ejecutarAuxiliarProcesoPreciosPorcentajeParaAjaxPostBack() throws Exception { try { } catch(Exception e) { FuncionesSwing.manageException(this, e,logger,ProcesoPreciosPorcentajeConstantesFunciones.CLASSNAME); } } public void jTextFieldValorCampoGeneralProcesoPreciosPorcentajeActionListener(ActionEvent evt) throws Exception { try { this.inicializarActualizarBindingProcesoPreciosPorcentaje(false,false); //System.out.println(this.jTextFieldValorCampoGeneralProcesoPreciosPorcentaje.getText()); Boolean existe=false; if(Constantes.ISUSAEJBLOGICLAYER) { for(ProcesoPreciosPorcentaje procesopreciosporcentajeAux:this.procesopreciosporcentajeLogic.getProcesoPreciosPorcentajes()) { if(sTipoSeleccionar.equals(ProcesoPreciosPorcentajeConstantesFunciones.LABEL_CODIGO)) { existe=true; procesopreciosporcentajeAux.setcodigo(this.sValorCampoGeneral); } else if(sTipoSeleccionar.equals(ProcesoPreciosPorcentajeConstantesFunciones.LABEL_NOMBRE)) { existe=true; procesopreciosporcentajeAux.setnombre(this.sValorCampoGeneral); } else if(sTipoSeleccionar.equals(ProcesoPreciosPorcentajeConstantesFunciones.LABEL_CODIGOPRODUCTO)) { existe=true; procesopreciosporcentajeAux.setcodigo_producto(this.sValorCampoGeneral); } else if(sTipoSeleccionar.equals(ProcesoPreciosPorcentajeConstantesFunciones.LABEL_NOMBREPRODUCTO)) { existe=true; procesopreciosporcentajeAux.setnombre_producto(this.sValorCampoGeneral); } else if(sTipoSeleccionar.equals(ProcesoPreciosPorcentajeConstantesFunciones.LABEL_PRECIO)) { existe=true; procesopreciosporcentajeAux.setprecio(Double.parseDouble(this.sValorCampoGeneral)); } else if(sTipoSeleccionar.equals(ProcesoPreciosPorcentajeConstantesFunciones.LABEL_PORCENTAJE)) { existe=true; procesopreciosporcentajeAux.setporcentaje(Double.parseDouble(this.sValorCampoGeneral)); } } } else if(Constantes.ISUSAEJBREMOTE||Constantes.ISUSAEJBHOME) { for(ProcesoPreciosPorcentaje procesopreciosporcentajeAux:procesopreciosporcentajes) { if(sTipoSeleccionar.equals(ProcesoPreciosPorcentajeConstantesFunciones.LABEL_CODIGO)) { existe=true; procesopreciosporcentajeAux.setcodigo(this.sValorCampoGeneral); } else if(sTipoSeleccionar.equals(ProcesoPreciosPorcentajeConstantesFunciones.LABEL_NOMBRE)) { existe=true; procesopreciosporcentajeAux.setnombre(this.sValorCampoGeneral); } else if(sTipoSeleccionar.equals(ProcesoPreciosPorcentajeConstantesFunciones.LABEL_CODIGOPRODUCTO)) { existe=true; procesopreciosporcentajeAux.setcodigo_producto(this.sValorCampoGeneral); } else if(sTipoSeleccionar.equals(ProcesoPreciosPorcentajeConstantesFunciones.LABEL_NOMBREPRODUCTO)) { existe=true; procesopreciosporcentajeAux.setnombre_producto(this.sValorCampoGeneral); } else if(sTipoSeleccionar.equals(ProcesoPreciosPorcentajeConstantesFunciones.LABEL_PRECIO)) { existe=true; procesopreciosporcentajeAux.setprecio(Double.parseDouble(this.sValorCampoGeneral)); } else if(sTipoSeleccionar.equals(ProcesoPreciosPorcentajeConstantesFunciones.LABEL_PORCENTAJE)) { existe=true; procesopreciosporcentajeAux.setporcentaje(Double.parseDouble(this.sValorCampoGeneral)); } } } if(existe) { this.inicializarActualizarBindingTablaProcesoPreciosPorcentaje(false); } else { JOptionPane.showMessageDialog(this,"NO SE HA SELECCIONADO ALGUNA COLUMNA VALIDA","SELECCIONAR",JOptionPane.ERROR_MESSAGE); } } catch(Exception e) { FuncionesSwing.manageException(this, e,logger,ProcesoPreciosPorcentajeConstantesFunciones.CLASSNAME); } } public void jComboBoxTiposAccionesProcesoPreciosPorcentajeActionListener(ActionEvent evt,Boolean esParaAccionDesdeFormulario) throws Exception { Boolean conSplash=true; try { this.inicializarActualizarBindingProcesoPreciosPorcentaje(false,false); Reporte reporte=new Reporte(); this.esParaAccionDesdeFormularioProcesoPreciosPorcentaje=esParaAccionDesdeFormulario; if(!esParaAccionDesdeFormulario) { reporte=(Reporte)this.jComboBoxTiposAccionesProcesoPreciosPorcentaje.getSelectedItem(); } else { reporte=(Reporte)this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jComboBoxTiposAccionesFormularioProcesoPreciosPorcentaje.getSelectedItem(); } String sTipoAccionLocal=this.sTipoAccion; if(!esParaAccionDesdeFormulario) { sTipoAccionLocal=this.sTipoAccion; } else { sTipoAccionLocal=this.sTipoAccionFormulario; } if(sTipoAccionLocal.equals("GENERAR REPORTE")) {//reporte.getsCodigo().equals("GENERAR REPORTE")) { if(this.isPermisoReporteProcesoPreciosPorcentaje) { conSplash=true;//false; //this.startProcessProcesoPreciosPorcentaje(conSplash); this.generarReporteProcesoPreciosPorcentajesSeleccionados(); } else { JOptionPane.showMessageDialog(this,"NO TIENE PERMISO PARA GENERAR REPORTES","REPORTE",JOptionPane.ERROR_MESSAGE); } if(!esParaAccionDesdeFormulario) { this.jComboBoxTiposAccionesProcesoPreciosPorcentaje.setSelectedIndex(0); } else { this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jComboBoxTiposAccionesFormularioProcesoPreciosPorcentaje.setSelectedIndex(0); } } else if(sTipoAccionLocal.equals("GENERAR REPORTE DINAMICO")) {//reporte.getsCodigo().equals("GENERAR_REPORTE_GROUP_GENERICO")) { //SE GENERA REPORTE SEGUN TIPO REPORTE SELECCIONADO //this.mostrarReporteDinamicoProcesoPreciosPorcentajesSeleccionados(); //this.jComboBoxTiposAccionesProcesoPreciosPorcentaje.setSelectedIndex(0); } else if(sTipoAccionLocal.equals("GENERAR_REPORTE_GROUP_GENERICO")) {//reporte.getsCodigo().equals("GENERAR_REPORTE_GROUP_GENERICO")) { //SE GENERA REPORTE SEGUN TIPO REPORTE SELECCIONADO //this.generarReporteGroupGenericoProcesoPreciosPorcentajesSeleccionados(false); //this.jComboBoxTiposAccionesProcesoPreciosPorcentaje.setSelectedIndex(0); } else if(sTipoAccionLocal.equals("GENERAR_REPORTE_TOTALES_GROUP_GENERICO")) {//reporte.getsCodigo().equals("GENERAR_REPORTE_GROUP_GENERICO")) { //SE GENERA REPORTE SEGUN TIPO REPORTE SELECCIONADO //this.generarReporteGroupGenericoProcesoPreciosPorcentajesSeleccionados(true); //this.jComboBoxTiposAccionesProcesoPreciosPorcentaje.setSelectedIndex(0); } else if(sTipoAccionLocal.equals("EXPORTAR_DATOS")) {//reporte.getsCodigo().equals("GENERAR_REPORTE_GROUP_GENERICO")) { //this.startProcessProcesoPreciosPorcentaje(); this.exportarProcesoPreciosPorcentajesSeleccionados(); if(!esParaAccionDesdeFormulario) { this.jComboBoxTiposAccionesProcesoPreciosPorcentaje.setSelectedIndex(0); } else { this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jComboBoxTiposAccionesFormularioProcesoPreciosPorcentaje.setSelectedIndex(0); } } else if(sTipoAccionLocal.equals("IMPORTAR_DATOS")) {//reporte.getsCodigo().equals("GENERAR_REPORTE_GROUP_GENERICO")) { this.mostrarImportacionProcesoPreciosPorcentajes(); //this.importarProcesoPreciosPorcentajes(); if(!esParaAccionDesdeFormulario) { this.jComboBoxTiposAccionesProcesoPreciosPorcentaje.setSelectedIndex(0); } else { this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jComboBoxTiposAccionesFormularioProcesoPreciosPorcentaje.setSelectedIndex(0); } } else if(sTipoAccionLocal.equals("EXPORTAR_DATOS_EXCEL")) {//reporte.getsCodigo().equals("GENERAR_REPORTE_GROUP_GENERICO")) { //this.startProcessProcesoPreciosPorcentaje(); //SE EXPORTA SEGUN TIPO ARCHIVO SELECCIONADO //this.exportarExcelProcesoPreciosPorcentajesSeleccionados(); //this.jComboBoxTiposAccionesProcesoPreciosPorcentaje.setSelectedIndex(0); } else if(sTipoAccionLocal.equals("RECARGAR_FK")) {//reporte.getsCodigo().equals("GENERAR_REPORTE_GROUP_GENERICO")) { if(JOptionPane.showConfirmDialog(this, "ESTA SEGURO DE RECARGAR REFERENCIAS ?", "MANTENIMIENTO DE Proceso Precios Porcentaje", JOptionPane.OK_CANCEL_OPTION) == 0) { //this.startProcessProcesoPreciosPorcentaje(); if(!esParaAccionDesdeFormulario || (esParaAccionDesdeFormulario && this.isEsNuevoProcesoPreciosPorcentaje)) { this.esRecargarFks=true; this.cargarCombosForeignKeyProcesoPreciosPorcentaje(false,false,false); this.esRecargarFks=false; JOptionPane.showMessageDialog(this,"PROCESO EJECUTADO CORRECTAMENTE","MANTENIMIENTO DE Proceso Precios Porcentaje",JOptionPane.INFORMATION_MESSAGE); } else { JOptionPane.showMessageDialog(this,"ESTE PROCESO SOLO FUNCIONA AL INGRESAR UN NUEVO ELEMENTO","MANTENIMIENTO",JOptionPane.ERROR_MESSAGE); } } if(!esParaAccionDesdeFormulario) { this.jComboBoxTiposAccionesProcesoPreciosPorcentaje.setSelectedIndex(0); } else { this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jComboBoxTiposAccionesFormularioProcesoPreciosPorcentaje.setSelectedIndex(0); } } else if(ProcesoPreciosPorcentajeBeanSwingJInternalFrame.EsProcesoReporte(reporte.getsCodigo())){ if(this.isPermisoReporteProcesoPreciosPorcentaje) { if(this.tieneElementosSeleccionados()) { this.quitarFilaTotales(); conSplash=false; //this.startProcessProcesoPreciosPorcentaje(conSplash); //this.actualizarParametrosGeneralProcesoPreciosPorcentaje(); this.generarReporteProcesoAccionProcesoPreciosPorcentajesSeleccionados(reporte.getsCodigo()); if(!esParaAccionDesdeFormulario) { this.jComboBoxTiposAccionesProcesoPreciosPorcentaje.setSelectedIndex(0); } else { this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jComboBoxTiposAccionesFormularioProcesoPreciosPorcentaje.setSelectedIndex(0); } } else { JOptionPane.showMessageDialog(this,"NO SE HA SELECCIONADO ALGUN ELEMENTO","SELECCIONAR",JOptionPane.ERROR_MESSAGE); } } else { JOptionPane.showMessageDialog(this,"NO TIENE PERMISO PARA GENERAR REPORTES","REPORTE",JOptionPane.ERROR_MESSAGE); } } else if(ProcesoPreciosPorcentajeBeanSwingJInternalFrameAdditional.EsProcesoAccionNormal(reporte.getsCodigo())){ if(this.tieneElementosSeleccionados()) { this.quitarFilaTotales(); if(JOptionPane.showConfirmDialog(this, "ESTA SEGURO DE PROCESAR "+reporte.getsDescripcion()+" EN PROCESO Proceso Precios PorcentajeS SELECCIONADOS?", "MANTENIMIENTO DE Proceso Precios Porcentaje", JOptionPane.OK_CANCEL_OPTION) == 0) { //this.startProcessProcesoPreciosPorcentaje(); this.actualizarParametrosGeneralProcesoPreciosPorcentaje(); //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeReturnGeneral=procesopreciosporcentajeLogic.procesarAccionProcesoPreciosPorcentajesWithConnection(this.parametroGeneralUsuario,this.moduloActual,this.opcionActual,this.usuarioActual,sTipoAccionLocal,this.procesopreciosporcentajeLogic.getProcesoPreciosPorcentajes(),this.procesopreciosporcentajeParameterGeneral); } else if(Constantes.ISUSAEJBREMOTE) { } else if(Constantes.ISUSAEJBHOME) { } //ARCHITECTURE this.procesarProcesoPreciosPorcentajeReturnGeneral(); if(!esParaAccionDesdeFormulario) { this.jComboBoxTiposAccionesProcesoPreciosPorcentaje.setSelectedIndex(0); } else { this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jComboBoxTiposAccionesFormularioProcesoPreciosPorcentaje.setSelectedIndex(0); } } } else { JOptionPane.showMessageDialog(this,"NO SE HA SELECCIONADO ALGUN ELEMENTO","SELECCIONAR",JOptionPane.ERROR_MESSAGE); } } else { if(this.tieneElementosSeleccionados()) { this.quitarFilaTotales(); this.actualizarParametrosGeneralProcesoPreciosPorcentaje(); ProcesoPreciosPorcentajeBeanSwingJInternalFrameAdditional.ProcesarAccion(reporte.getsCodigo(),reporte.getsDescripcion(),this); this.procesarProcesoPreciosPorcentajeReturnGeneral(); if(!esParaAccionDesdeFormulario) { this.jComboBoxTiposAccionesProcesoPreciosPorcentaje.setSelectedIndex(0); } else { this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jComboBoxTiposAccionesFormularioProcesoPreciosPorcentaje.setSelectedIndex(0); } } else { JOptionPane.showMessageDialog(this,"NO SE HA SELECCIONADO ALGUN ELEMENTO","SELECCIONAR",JOptionPane.ERROR_MESSAGE); } } } catch(Exception e) { this.esRecargarFks=false; FuncionesSwing.manageException(this, e,logger,ProcesoPreciosPorcentajeConstantesFunciones.CLASSNAME); } finally { //this.finishProcessProcesoPreciosPorcentaje(conSplash); } } public void jComboBoxTiposRelacionesProcesoPreciosPorcentajeActionListener(ActionEvent evt) throws Exception { Boolean conSplash=true; try { this.startProcessProcesoPreciosPorcentaje(); if(this.jInternalFrameDetalleFormProcesoPreciosPorcentaje==null) { //if(!this.conCargarFormDetalle) { this.inicializarFormDetalle(); } ArrayList<ProcesoPreciosPorcentaje> procesopreciosporcentajesSeleccionados=new ArrayList<ProcesoPreciosPorcentaje>(); ProcesoPreciosPorcentaje procesopreciosporcentaje=new ProcesoPreciosPorcentaje(); int rowIndex=-1;//CON ESTO SE DESHABILITA SELECCION POR INDICE this.inicializarActualizarBindingProcesoPreciosPorcentaje(false,false); Reporte reporte=new Reporte(); reporte=(Reporte)this.jComboBoxTiposRelacionesProcesoPreciosPorcentaje.getSelectedItem(); procesopreciosporcentajesSeleccionados=this.getProcesoPreciosPorcentajesSeleccionados(true); //this.sTipoAccion; if(procesopreciosporcentajesSeleccionados.size()==1) { for(ProcesoPreciosPorcentaje procesopreciosporcentajeAux:procesopreciosporcentajesSeleccionados) { procesopreciosporcentaje=procesopreciosporcentajeAux; } if(this.sTipoAccion.equals("NONE")) { } } else { JOptionPane.showMessageDialog(this,"SELECCIONE SOLO UN REGISTRO","RELACIONES",JOptionPane.ERROR_MESSAGE); } } catch(Exception e) { FuncionesSwing.manageException(this, e,logger,ProcesoPreciosPorcentajeConstantesFunciones.CLASSNAME); } finally { this.finishProcessProcesoPreciosPorcentaje(); //this.finishProcessProcesoPreciosPorcentaje(conSplash); } } public static Boolean EsProcesoReporte(String sTipoProceso) throws Exception { Boolean esProcesoAccionRepoorte=false; if(sTipoProceso.contains("REPORTE_")) { esProcesoAccionRepoorte=true; } return esProcesoAccionRepoorte; } public void procesarProcesoPreciosPorcentajeReturnGeneral() throws Exception { if(this.procesopreciosporcentajeReturnGeneral.getConRetornoEstaProcesado()) { JOptionPane.showMessageDialog(this,this.procesopreciosporcentajeReturnGeneral.getsMensajeProceso(),"PROCESO",JOptionPane.INFORMATION_MESSAGE); } if(this.procesopreciosporcentajeReturnGeneral.getConMostrarMensaje()) { JOptionPane.showMessageDialog(this,this.procesopreciosporcentajeReturnGeneral.getsMensajeProceso(),"PROCESO",FuncionesSwing.getColorSelectedBackground(this.procesopreciosporcentajeReturnGeneral.getsTipoMensaje())); } if(this.procesopreciosporcentajeReturnGeneral.getConRecargarInformacion()) { this.procesarBusqueda(this.sAccionBusqueda); this.inicializarActualizarBindingProcesoPreciosPorcentaje(false); } if(this.procesopreciosporcentajeReturnGeneral.getConRetornoLista() || this.procesopreciosporcentajeReturnGeneral.getConRetornoObjeto()) { if(this.procesopreciosporcentajeReturnGeneral.getConRetornoLista()) { //ARCHITECTURE if(Constantes.ISUSAEJBLOGICLAYER) { this.procesopreciosporcentajeLogic.setProcesoPreciosPorcentajes(this.procesopreciosporcentajeReturnGeneral.getProcesoPreciosPorcentajes()); } else if(Constantes.ISUSAEJBREMOTE) { } else if(Constantes.ISUSAEJBHOME) { } //ARCHITECTURE } this.inicializarActualizarBindingProcesoPreciosPorcentaje(false); } } public void actualizarParametrosGeneralProcesoPreciosPorcentaje() throws Exception { } public ArrayList<ProcesoPreciosPorcentaje> getProcesoPreciosPorcentajesSeleccionados(Boolean conSeleccionarTodosAutomatico) throws Exception { ArrayList<ProcesoPreciosPorcentaje> procesopreciosporcentajesSeleccionados=new ArrayList<ProcesoPreciosPorcentaje>(); Boolean existe=false; if(!this.esParaAccionDesdeFormularioProcesoPreciosPorcentaje) { if(Constantes.ISUSAEJBLOGICLAYER) { for(ProcesoPreciosPorcentaje procesopreciosporcentajeAux:procesopreciosporcentajeLogic.getProcesoPreciosPorcentajes()) { if(procesopreciosporcentajeAux.getIsSelected()) { procesopreciosporcentajesSeleccionados.add(procesopreciosporcentajeAux); } } } else if(Constantes.ISUSAEJBREMOTE||Constantes.ISUSAEJBHOME) { for(ProcesoPreciosPorcentaje procesopreciosporcentajeAux:this.procesopreciosporcentajes) { if(procesopreciosporcentajeAux.getIsSelected()) { procesopreciosporcentajesSeleccionados.add(procesopreciosporcentajeAux); } } } if(procesopreciosporcentajesSeleccionados.size()>0) { existe=true; } //SI NO ESTA NINGUNO SELECCIONADO SE SELECCIONA TODOS if(!existe) { if(conSeleccionarTodosAutomatico) { if(Constantes.ISUSAEJBLOGICLAYER) { procesopreciosporcentajesSeleccionados.addAll(this.procesopreciosporcentajeLogic.getProcesoPreciosPorcentajes()); } else if(Constantes.ISUSAEJBREMOTE||Constantes.ISUSAEJBHOME) { procesopreciosporcentajesSeleccionados.addAll(this.procesopreciosporcentajes); } } } } else { procesopreciosporcentajesSeleccionados.add(this.procesopreciosporcentaje); } return procesopreciosporcentajesSeleccionados; } public void actualizarVariablesTipoReporte(Boolean esReporteNormal,Boolean esReporteDinamico,Boolean esReporteAccionProceso,String sPath) { if(esReporteNormal) { this.sTipoReporteExtra=""; this.esReporteDinamico=false; this.sPathReporteDinamico=""; this.esReporteAccionProceso=false; } else if(esReporteAccionProceso) { this.sTipoReporteExtra=""; this.esReporteDinamico=false; this.sPathReporteDinamico=""; this.esReporteAccionProceso=true; } else if(esReporteDinamico) { this.sTipoReporteExtra=""; this.esReporteDinamico=true; this.esReporteAccionProceso=false; this.sPathReporteDinamico=sPath.replace(".jrxml",".jasper"); } } public void generarReporteProcesoPreciosPorcentajesSeleccionados() throws Exception { Boolean existe=false; if(this.sTipoReporte.equals("NORMAL") || this.sTipoReporte.equals("FORMULARIO")) { existe=true; this.generarReporteNormalProcesoPreciosPorcentajesSeleccionados(); } else if(this.sTipoReporte.equals("DINAMICO")) { existe=true; this.mostrarReporteDinamicoProcesoPreciosPorcentajesSeleccionados(); } else if(this.sTipoReporte.equals("GRUPO_GENERICO")) { existe=true; this.generarReporteGroupGenericoProcesoPreciosPorcentajesSeleccionados(false); } else if(this.sTipoReporte.equals("TOTALES_GRUPO_GENERICO")) { existe=true; this.generarReporteGroupGenericoProcesoPreciosPorcentajesSeleccionados(true); } if(!existe) { JOptionPane.showMessageDialog(this,"SELECCIONE UN TIPO DE REPORTE VALIDO","REPORTE DE Proceso Precios Porcentaje",JOptionPane.ERROR_MESSAGE); } } public void generarReporteRelacionesProcesoPreciosPorcentajesSeleccionados() throws Exception { ArrayList<ProcesoPreciosPorcentaje> procesopreciosporcentajesSeleccionados=new ArrayList<ProcesoPreciosPorcentaje>(); procesopreciosporcentajesSeleccionados=this.getProcesoPreciosPorcentajesSeleccionados(true); this.actualizarVariablesTipoReporte(true,false,false,""); //this.sTipoReporteExtra="MasterRelaciones"; /* this.sTipoReporteExtra=""; this.esReporteDinamico=false; this.sPathReporteDinamico=""; */ this.generarReporteProcesoPreciosPorcentajes("Todos",procesopreciosporcentajesSeleccionados); } public void generarReporteNormalProcesoPreciosPorcentajesSeleccionados() throws Exception { ArrayList<ProcesoPreciosPorcentaje> procesopreciosporcentajesSeleccionados=new ArrayList<ProcesoPreciosPorcentaje>(); procesopreciosporcentajesSeleccionados=this.getProcesoPreciosPorcentajesSeleccionados(true); this.actualizarVariablesTipoReporte(true,false,false,""); if(this.sTipoReporte.equals("FORMULARIO")) { this.sTipoReporteExtra="Vertical"; } /* this.sTipoReporteExtra=""; this.esReporteDinamico=false; this.sPathReporteDinamico=""; */ this.generarReporteProcesoPreciosPorcentajes("Todos",procesopreciosporcentajesSeleccionados); } public void generarReporteProcesoAccionProcesoPreciosPorcentajesSeleccionados(String sProcesoReporte) throws Exception { ArrayList<ProcesoPreciosPorcentaje> procesopreciosporcentajesSeleccionados=new ArrayList<ProcesoPreciosPorcentaje>(); procesopreciosporcentajesSeleccionados=this.getProcesoPreciosPorcentajesSeleccionados(true); this.actualizarVariablesTipoReporte(false,false,true,""); /* this.esReporteDinamico=false; this.sPathReporteDinamico=""; */ this.sTipoReporteExtra=sProcesoReporte.toLowerCase(); this.esReporteAccionProceso=true; this.generarReporteProcesoPreciosPorcentajes("Todos",procesopreciosporcentajesSeleccionados); this.esReporteAccionProceso=false; } public void mostrarReporteDinamicoProcesoPreciosPorcentajesSeleccionados() throws Exception { ArrayList<ProcesoPreciosPorcentaje> procesopreciosporcentajesSeleccionados=new ArrayList<ProcesoPreciosPorcentaje>(); this.abrirInicializarFrameReporteDinamicoProcesoPreciosPorcentaje(); procesopreciosporcentajesSeleccionados=this.getProcesoPreciosPorcentajesSeleccionados(true); this.sTipoReporteExtra=""; //this.actualizarVariablesTipoReporte(true,false,false,""); this.abrirFrameReporteDinamicoProcesoPreciosPorcentaje(); //this.generarReporteProcesoPreciosPorcentajes("Todos",procesopreciosporcentajesSeleccionados ,procesopreciosporcentajeImplementable,procesopreciosporcentajeImplementableHome); } public void mostrarImportacionProcesoPreciosPorcentajes() throws Exception { //this.sTipoReporteExtra=""; //this.actualizarVariablesTipoReporte(true,false,false,""); this.abrirInicializarFrameImportacionProcesoPreciosPorcentaje(); this.abrirFrameImportacionProcesoPreciosPorcentaje(); //this.generarReporteProcesoPreciosPorcentajes("Todos",procesopreciosporcentajesSeleccionados ,procesopreciosporcentajeImplementable,procesopreciosporcentajeImplementableHome); } public void importarProcesoPreciosPorcentajes() throws Exception { } public void exportarProcesoPreciosPorcentajesSeleccionados() throws Exception { Boolean existe=false; if(this.sTipoArchivoReporte.equals("EXCEL")) { existe=true; this.exportarExcelProcesoPreciosPorcentajesSeleccionados(); } else if(this.sTipoArchivoReporte.equals("TEXTO")) { existe=true; this.exportarTextoProcesoPreciosPorcentajesSeleccionados(); } else if(this.sTipoArchivoReporte.equals("XML")) { existe=true; this.exportarXmlProcesoPreciosPorcentajesSeleccionados(); } if(!existe) { JOptionPane.showMessageDialog(this,"SELECCIONE UN TIPO DE ARCHIVO VALIDO","EXPORTACION DE Proceso Precios Porcentaje",JOptionPane.ERROR_MESSAGE); } } public void exportarTextoProcesoPreciosPorcentajesSeleccionados() throws Exception { ArrayList<ProcesoPreciosPorcentaje> procesopreciosporcentajesSeleccionados=new ArrayList<ProcesoPreciosPorcentaje>(); procesopreciosporcentajesSeleccionados=this.getProcesoPreciosPorcentajesSeleccionados(true); String sTipo=Funciones2.getTipoExportar(this.parametroGeneralUsuario); Boolean conCabecera=this.parametroGeneralUsuario.getcon_exportar_cabecera(); String sDelimiter=Funciones2.getTipoDelimiter(this.parametroGeneralUsuario); String sPath=this.parametroGeneralUsuario.getpath_exportar()+"procesopreciosporcentaje."+"txt";//Funciones2.getTipoExtensionArchivoExportar(this.parametroGeneralUsuario); String sFilaCabecera=""; String sFilaDatos=""; BufferedWriter bufferedWriter = null; FileWriter fileWriter=null; fileWriter=new FileWriter(sPath); bufferedWriter = new BufferedWriter(fileWriter); try { if(conCabecera) { sFilaCabecera=this.getFilaCabeceraExportarProcesoPreciosPorcentaje(sDelimiter); bufferedWriter.write(sFilaCabecera); } for(ProcesoPreciosPorcentaje procesopreciosporcentajeAux:procesopreciosporcentajesSeleccionados) { sFilaDatos=this.getFilaDatosExportarProcesoPreciosPorcentaje(procesopreciosporcentajeAux,sDelimiter); bufferedWriter.write(sFilaDatos); //procesopreciosporcentajeAux.setsDetalleGeneralEntityReporte(procesopreciosporcentajeAux.toString()); } bufferedWriter.close(); Constantes2.S_PATH_ULTIMO_ARCHIVO=sPath; if(this.parametroGeneralUsuario.getcon_mensaje_confirmacion() && !this.procesopreciosporcentajeSessionBean.getEsGuardarRelacionado()) {//Constantes.ISMOSTRARMENSAJESMANTENIMIENTO && JOptionPane.showMessageDialog(this,"EXPORTADO CORRECTAMENTE:"+sPath,"MANTENIMIENTO DE Proceso Precios Porcentaje",JOptionPane.INFORMATION_MESSAGE); } } catch (Exception e) { throw e; } finally { if (bufferedWriter != null) { bufferedWriter.close(); } } } public String getFilaCabeceraExportarProcesoPreciosPorcentaje(String sDelimiter) { String sFilaCabecera=""; sFilaCabecera+=ProcesoPreciosPorcentajeConstantesFunciones.LABEL_ID; if(parametroGeneralUsuario.getcon_exportar_campo_version()){ sFilaCabecera+=sDelimiter; sFilaCabecera+=ProcesoPreciosPorcentajeConstantesFunciones.LABEL_VERSIONROW; } sFilaCabecera+=sDelimiter; sFilaCabecera+=ProcesoPreciosPorcentajeConstantesFunciones.LABEL_IDBODEGA; sFilaCabecera+=sDelimiter; sFilaCabecera+=ProcesoPreciosPorcentajeConstantesFunciones.LABEL_IDPRODUCTO; sFilaCabecera+=sDelimiter; sFilaCabecera+=ProcesoPreciosPorcentajeConstantesFunciones.LABEL_IDEMPRESA; sFilaCabecera+=sDelimiter; sFilaCabecera+=ProcesoPreciosPorcentajeConstantesFunciones.LABEL_IDSUCURSAL; sFilaCabecera+=sDelimiter; sFilaCabecera+=ProcesoPreciosPorcentajeConstantesFunciones.LABEL_IDLINEA; sFilaCabecera+=sDelimiter; sFilaCabecera+=ProcesoPreciosPorcentajeConstantesFunciones.LABEL_IDLINEAGRUPO; sFilaCabecera+=sDelimiter; sFilaCabecera+=ProcesoPreciosPorcentajeConstantesFunciones.LABEL_IDLINEACATEGORIA; sFilaCabecera+=sDelimiter; sFilaCabecera+=ProcesoPreciosPorcentajeConstantesFunciones.LABEL_IDLINEAMARCA; sFilaCabecera+=sDelimiter; sFilaCabecera+=ProcesoPreciosPorcentajeConstantesFunciones.LABEL_CODIGO; sFilaCabecera+=sDelimiter; sFilaCabecera+=ProcesoPreciosPorcentajeConstantesFunciones.LABEL_NOMBRE; sFilaCabecera+=sDelimiter; sFilaCabecera+=ProcesoPreciosPorcentajeConstantesFunciones.LABEL_CODIGOPRODUCTO; sFilaCabecera+=sDelimiter; sFilaCabecera+=ProcesoPreciosPorcentajeConstantesFunciones.LABEL_NOMBREPRODUCTO; sFilaCabecera+=sDelimiter; sFilaCabecera+=ProcesoPreciosPorcentajeConstantesFunciones.LABEL_PRECIO; sFilaCabecera+=sDelimiter; sFilaCabecera+=ProcesoPreciosPorcentajeConstantesFunciones.LABEL_PORCENTAJE; return sFilaCabecera; } public String getFilaDatosExportarProcesoPreciosPorcentaje(ProcesoPreciosPorcentaje procesopreciosporcentaje,String sDelimiter) { String sFilaDatos=""; sFilaDatos+="\r\n"; sFilaDatos+=procesopreciosporcentaje.getId().toString(); if(parametroGeneralUsuario.getcon_exportar_campo_version()){ sFilaDatos+=sDelimiter; sFilaDatos+=procesopreciosporcentaje.getVersionRow().toString(); } sFilaDatos+=sDelimiter; sFilaDatos+=procesopreciosporcentaje.getbodega_descripcion(); sFilaDatos+=sDelimiter; sFilaDatos+=procesopreciosporcentaje.getproducto_descripcion(); sFilaDatos+=sDelimiter; sFilaDatos+=procesopreciosporcentaje.getempresa_descripcion(); sFilaDatos+=sDelimiter; sFilaDatos+=procesopreciosporcentaje.getsucursal_descripcion(); sFilaDatos+=sDelimiter; sFilaDatos+=procesopreciosporcentaje.getlinea_descripcion(); sFilaDatos+=sDelimiter; sFilaDatos+=procesopreciosporcentaje.getlineagrupo_descripcion(); sFilaDatos+=sDelimiter; sFilaDatos+=procesopreciosporcentaje.getlineacategoria_descripcion(); sFilaDatos+=sDelimiter; sFilaDatos+=procesopreciosporcentaje.getlineamarca_descripcion(); sFilaDatos+=sDelimiter; sFilaDatos+=procesopreciosporcentaje.getcodigo(); sFilaDatos+=sDelimiter; sFilaDatos+=procesopreciosporcentaje.getnombre(); sFilaDatos+=sDelimiter; sFilaDatos+=procesopreciosporcentaje.getcodigo_producto(); sFilaDatos+=sDelimiter; sFilaDatos+=procesopreciosporcentaje.getnombre_producto(); sFilaDatos+=sDelimiter; sFilaDatos+=procesopreciosporcentaje.getprecio().toString(); sFilaDatos+=sDelimiter; sFilaDatos+=procesopreciosporcentaje.getporcentaje().toString(); return sFilaDatos; } //@SuppressWarnings("deprecation") public void exportarExcelProcesoPreciosPorcentajesSeleccionados() throws Exception { ArrayList<ProcesoPreciosPorcentaje> procesopreciosporcentajesSeleccionados=new ArrayList<ProcesoPreciosPorcentaje>(); procesopreciosporcentajesSeleccionados=this.getProcesoPreciosPorcentajesSeleccionados(true); String sTipo=Funciones2.getTipoExportar(this.parametroGeneralUsuario); Boolean conCabecera=this.parametroGeneralUsuario.getcon_exportar_cabecera(); String sDelimiter=Funciones2.getTipoDelimiter(this.parametroGeneralUsuario); String sPath=this.parametroGeneralUsuario.getpath_exportar()+"procesopreciosporcentaje.xls"; String sFilaCabecera=""; String sFilaDatos=""; FileOutputStream fileOutputStream=null; try { HSSFWorkbook workbook = new HSSFWorkbook(); HSSFSheet sheet = workbook.createSheet("ProcesoPreciosPorcentajes"); Integer iRow=0; Integer iCell=0; HSSFRow row = sheet.createRow(iRow); HSSFCell cell = row.createCell(iCell); //cell.setCellValue("Blahblah"); if(conCabecera) { this.getFilaCabeceraExportarExcelProcesoPreciosPorcentaje(row); iRow++; } for(ProcesoPreciosPorcentaje procesopreciosporcentajeAux:procesopreciosporcentajesSeleccionados) { row = sheet.createRow(iRow); this.getFilaDatosExportarExcelProcesoPreciosPorcentaje(procesopreciosporcentajeAux,row); iRow++; } fileOutputStream = new FileOutputStream(new File(sPath)); workbook.write(fileOutputStream); //fileOutputStream.close(); Constantes2.S_PATH_ULTIMO_ARCHIVO=sPath; if(this.parametroGeneralUsuario.getcon_mensaje_confirmacion() && !this.procesopreciosporcentajeSessionBean.getEsGuardarRelacionado()) {//Constantes.ISMOSTRARMENSAJESMANTENIMIENTO && JOptionPane.showMessageDialog(this,"EXPORTADO CORRECTAMENTE:"+sPath,"MANTENIMIENTO DE Proceso Precios Porcentaje",JOptionPane.INFORMATION_MESSAGE); } } catch (Exception e) { throw e; } finally { if (fileOutputStream != null) { fileOutputStream.close(); } } } public void exportarXmlProcesoPreciosPorcentajesSeleccionados() throws Exception { ArrayList<ProcesoPreciosPorcentaje> procesopreciosporcentajesSeleccionados=new ArrayList<ProcesoPreciosPorcentaje>(); procesopreciosporcentajesSeleccionados=this.getProcesoPreciosPorcentajesSeleccionados(true); //String sTipo=Funciones2.getTipoExportar(this.parametroGeneralUsuario); //Boolean conCabecera=this.parametroGeneralUsuario.getcon_exportar_cabecera(); //String sDelimiter=Funciones2.getTipoDelimiter(this.parametroGeneralUsuario); String sPath=this.parametroGeneralUsuario.getpath_exportar()+"procesopreciosporcentaje.xml"; String sFilaCabecera=""; String sFilaDatos=""; DocumentBuilderFactory documentBuilderFactory=null; DocumentBuilder documentBuilder =null; try { documentBuilderFactory = DocumentBuilderFactory.newInstance(); documentBuilder = documentBuilderFactory.newDocumentBuilder(); Document document = documentBuilder.newDocument(); Element elementRoot = document.createElement("procesopreciosporcentajes"); document.appendChild(elementRoot); Element element = null;//document.createElement("procesopreciosporcentaje"); //elementRoot.appendChild(element); for(ProcesoPreciosPorcentaje procesopreciosporcentajeAux:procesopreciosporcentajesSeleccionados) { element = document.createElement("procesopreciosporcentaje"); elementRoot.appendChild(element); this.setFilaDatosExportarXmlProcesoPreciosPorcentaje(procesopreciosporcentajeAux,document,element); } TransformerFactory transformerFactory = TransformerFactory.newInstance(); Transformer transformer = transformerFactory.newTransformer(); DOMSource domSource = new DOMSource(document); StreamResult streamResult = new StreamResult(new File(sPath)); transformer.transform(domSource, streamResult); Constantes2.S_PATH_ULTIMO_ARCHIVO=sPath; if(this.parametroGeneralUsuario.getcon_mensaje_confirmacion() && !this.procesopreciosporcentajeSessionBean.getEsGuardarRelacionado()) {//Constantes.ISMOSTRARMENSAJESMANTENIMIENTO && JOptionPane.showMessageDialog(this,"EXPORTADO CORRECTAMENTE:"+sPath,"MANTENIMIENTO DE Proceso Precios Porcentaje",JOptionPane.INFORMATION_MESSAGE); } } catch (Exception e) { throw e; } finally { } } //@SuppressWarnings("deprecation") public void getFilaCabeceraExportarExcelProcesoPreciosPorcentaje(HSSFRow row) { Integer iColumn=0; HSSFCell cell =null; cell = row.createCell(iColumn++);cell.setCellValue(ProcesoPreciosPorcentajeConstantesFunciones.LABEL_ID); if(parametroGeneralUsuario.getcon_exportar_campo_version()){ cell = row.createCell(iColumn++);cell.setCellValue(ProcesoPreciosPorcentajeConstantesFunciones.LABEL_VERSIONROW); } cell = row.createCell(iColumn++);cell.setCellValue(ProcesoPreciosPorcentajeConstantesFunciones.LABEL_IDBODEGA); cell = row.createCell(iColumn++);cell.setCellValue(ProcesoPreciosPorcentajeConstantesFunciones.LABEL_IDPRODUCTO); cell = row.createCell(iColumn++);cell.setCellValue(ProcesoPreciosPorcentajeConstantesFunciones.LABEL_IDEMPRESA); cell = row.createCell(iColumn++);cell.setCellValue(ProcesoPreciosPorcentajeConstantesFunciones.LABEL_IDSUCURSAL); cell = row.createCell(iColumn++);cell.setCellValue(ProcesoPreciosPorcentajeConstantesFunciones.LABEL_IDLINEA); cell = row.createCell(iColumn++);cell.setCellValue(ProcesoPreciosPorcentajeConstantesFunciones.LABEL_IDLINEAGRUPO); cell = row.createCell(iColumn++);cell.setCellValue(ProcesoPreciosPorcentajeConstantesFunciones.LABEL_IDLINEACATEGORIA); cell = row.createCell(iColumn++);cell.setCellValue(ProcesoPreciosPorcentajeConstantesFunciones.LABEL_IDLINEAMARCA); cell = row.createCell(iColumn++);cell.setCellValue(ProcesoPreciosPorcentajeConstantesFunciones.LABEL_CODIGO); cell = row.createCell(iColumn++);cell.setCellValue(ProcesoPreciosPorcentajeConstantesFunciones.LABEL_NOMBRE); cell = row.createCell(iColumn++);cell.setCellValue(ProcesoPreciosPorcentajeConstantesFunciones.LABEL_CODIGOPRODUCTO); cell = row.createCell(iColumn++);cell.setCellValue(ProcesoPreciosPorcentajeConstantesFunciones.LABEL_NOMBREPRODUCTO); cell = row.createCell(iColumn++);cell.setCellValue(ProcesoPreciosPorcentajeConstantesFunciones.LABEL_PRECIO); cell = row.createCell(iColumn++);cell.setCellValue(ProcesoPreciosPorcentajeConstantesFunciones.LABEL_PORCENTAJE); } //@SuppressWarnings("deprecation") public void getFilaDatosExportarExcelProcesoPreciosPorcentaje(ProcesoPreciosPorcentaje procesopreciosporcentaje,HSSFRow row) { Integer iColumn=0; HSSFCell cell =null; cell = row.createCell(iColumn++);cell.setCellValue(procesopreciosporcentaje.getId()); cell = row.createCell(iColumn++);cell.setCellValue(procesopreciosporcentaje.getbodega_descripcion()); cell = row.createCell(iColumn++);cell.setCellValue(procesopreciosporcentaje.getproducto_descripcion()); cell = row.createCell(iColumn++);cell.setCellValue(procesopreciosporcentaje.getempresa_descripcion()); cell = row.createCell(iColumn++);cell.setCellValue(procesopreciosporcentaje.getsucursal_descripcion()); cell = row.createCell(iColumn++);cell.setCellValue(procesopreciosporcentaje.getlinea_descripcion()); cell = row.createCell(iColumn++);cell.setCellValue(procesopreciosporcentaje.getlineagrupo_descripcion()); cell = row.createCell(iColumn++);cell.setCellValue(procesopreciosporcentaje.getlineacategoria_descripcion()); cell = row.createCell(iColumn++);cell.setCellValue(procesopreciosporcentaje.getlineamarca_descripcion()); cell = row.createCell(iColumn++);cell.setCellValue(procesopreciosporcentaje.getcodigo()); cell = row.createCell(iColumn++);cell.setCellValue(procesopreciosporcentaje.getnombre()); cell = row.createCell(iColumn++);cell.setCellValue(procesopreciosporcentaje.getcodigo_producto()); cell = row.createCell(iColumn++);cell.setCellValue(procesopreciosporcentaje.getnombre_producto()); cell = row.createCell(iColumn++);cell.setCellValue(procesopreciosporcentaje.getprecio()); cell = row.createCell(iColumn++);cell.setCellValue(procesopreciosporcentaje.getporcentaje()); } public void setFilaDatosExportarXmlProcesoPreciosPorcentaje(ProcesoPreciosPorcentaje procesopreciosporcentaje,Document document,Element element) { /* Element lastname = document.createElement("lastname"); lastname.appendChild(document.createTextNode("mook kim")); element.appendChild(lastname); */ Element elementId = document.createElement(ProcesoPreciosPorcentajeConstantesFunciones.ID); elementId.appendChild(document.createTextNode(procesopreciosporcentaje.getId().toString().trim())); element.appendChild(elementId); if(parametroGeneralUsuario.getcon_exportar_campo_version()){ Element elementVersionRow = document.createElement(ProcesoPreciosPorcentajeConstantesFunciones.VERSIONROW); elementVersionRow.appendChild(document.createTextNode(procesopreciosporcentaje.getVersionRow().toString().trim())); element.appendChild(elementVersionRow); } Element elementbodega_descripcion = document.createElement(ProcesoPreciosPorcentajeConstantesFunciones.IDBODEGA); elementbodega_descripcion.appendChild(document.createTextNode(procesopreciosporcentaje.getbodega_descripcion())); element.appendChild(elementbodega_descripcion); Element elementproducto_descripcion = document.createElement(ProcesoPreciosPorcentajeConstantesFunciones.IDPRODUCTO); elementproducto_descripcion.appendChild(document.createTextNode(procesopreciosporcentaje.getproducto_descripcion())); element.appendChild(elementproducto_descripcion); Element elementempresa_descripcion = document.createElement(ProcesoPreciosPorcentajeConstantesFunciones.IDEMPRESA); elementempresa_descripcion.appendChild(document.createTextNode(procesopreciosporcentaje.getempresa_descripcion())); element.appendChild(elementempresa_descripcion); Element elementsucursal_descripcion = document.createElement(ProcesoPreciosPorcentajeConstantesFunciones.IDSUCURSAL); elementsucursal_descripcion.appendChild(document.createTextNode(procesopreciosporcentaje.getsucursal_descripcion())); element.appendChild(elementsucursal_descripcion); Element elementlinea_descripcion = document.createElement(ProcesoPreciosPorcentajeConstantesFunciones.IDLINEA); elementlinea_descripcion.appendChild(document.createTextNode(procesopreciosporcentaje.getlinea_descripcion())); element.appendChild(elementlinea_descripcion); Element elementlineagrupo_descripcion = document.createElement(ProcesoPreciosPorcentajeConstantesFunciones.IDLINEAGRUPO); elementlineagrupo_descripcion.appendChild(document.createTextNode(procesopreciosporcentaje.getlineagrupo_descripcion())); element.appendChild(elementlineagrupo_descripcion); Element elementlineacategoria_descripcion = document.createElement(ProcesoPreciosPorcentajeConstantesFunciones.IDLINEACATEGORIA); elementlineacategoria_descripcion.appendChild(document.createTextNode(procesopreciosporcentaje.getlineacategoria_descripcion())); element.appendChild(elementlineacategoria_descripcion); Element elementlineamarca_descripcion = document.createElement(ProcesoPreciosPorcentajeConstantesFunciones.IDLINEAMARCA); elementlineamarca_descripcion.appendChild(document.createTextNode(procesopreciosporcentaje.getlineamarca_descripcion())); element.appendChild(elementlineamarca_descripcion); Element elementcodigo = document.createElement(ProcesoPreciosPorcentajeConstantesFunciones.CODIGO); elementcodigo.appendChild(document.createTextNode(procesopreciosporcentaje.getcodigo().trim())); element.appendChild(elementcodigo); Element elementnombre = document.createElement(ProcesoPreciosPorcentajeConstantesFunciones.NOMBRE); elementnombre.appendChild(document.createTextNode(procesopreciosporcentaje.getnombre().trim())); element.appendChild(elementnombre); Element elementcodigo_producto = document.createElement(ProcesoPreciosPorcentajeConstantesFunciones.CODIGOPRODUCTO); elementcodigo_producto.appendChild(document.createTextNode(procesopreciosporcentaje.getcodigo_producto().trim())); element.appendChild(elementcodigo_producto); Element elementnombre_producto = document.createElement(ProcesoPreciosPorcentajeConstantesFunciones.NOMBREPRODUCTO); elementnombre_producto.appendChild(document.createTextNode(procesopreciosporcentaje.getnombre_producto().trim())); element.appendChild(elementnombre_producto); Element elementprecio = document.createElement(ProcesoPreciosPorcentajeConstantesFunciones.PRECIO); elementprecio.appendChild(document.createTextNode(procesopreciosporcentaje.getprecio().toString().trim())); element.appendChild(elementprecio); Element elementporcentaje = document.createElement(ProcesoPreciosPorcentajeConstantesFunciones.PORCENTAJE); elementporcentaje.appendChild(document.createTextNode(procesopreciosporcentaje.getporcentaje().toString().trim())); element.appendChild(elementporcentaje); } public void generarReporteGroupGenericoProcesoPreciosPorcentajesSeleccionados(Boolean soloTotales) throws Exception { ArrayList<ProcesoPreciosPorcentaje> procesopreciosporcentajesSeleccionados=new ArrayList<ProcesoPreciosPorcentaje>(); procesopreciosporcentajesSeleccionados=this.getProcesoPreciosPorcentajesSeleccionados(true); this.actualizarVariablesTipoReporte(true,false,false,""); /* this.esReporteDinamico=false; this.sPathReporteDinamico=""; */ if(!soloTotales) { this.sTipoReporteExtra=Constantes2.S_REPORTE_EXTRA_GROUP_GENERICO; } else { this.sTipoReporteExtra=Constantes2.S_REPORTE_EXTRA_GROUP_TOTALES_GENERICO; } this.setColumnaDescripcionReporteGroupGenericoProcesoPreciosPorcentaje(procesopreciosporcentajesSeleccionados); this.generarReporteProcesoPreciosPorcentajes("Todos",procesopreciosporcentajesSeleccionados); } public void setColumnaDescripcionReporteGroupGenericoProcesoPreciosPorcentaje(ArrayList<ProcesoPreciosPorcentaje> procesopreciosporcentajesSeleccionados) throws Exception { try { //FUNCIONA CON MODEL PERO SE DANA MANTENIMIENTO Boolean existe=false; for(ProcesoPreciosPorcentaje procesopreciosporcentajeAux:procesopreciosporcentajesSeleccionados) { procesopreciosporcentajeAux.setsDetalleGeneralEntityReporte(procesopreciosporcentajeAux.toString()); if(sTipoSeleccionar.equals(ProcesoPreciosPorcentajeConstantesFunciones.LABEL_IDBODEGA)) { existe=true; procesopreciosporcentajeAux.setsDescripcionGeneralEntityReporte1(procesopreciosporcentajeAux.getbodega_descripcion()); } else if(sTipoSeleccionar.equals(ProcesoPreciosPorcentajeConstantesFunciones.LABEL_IDPRODUCTO)) { existe=true; procesopreciosporcentajeAux.setsDescripcionGeneralEntityReporte1(procesopreciosporcentajeAux.getproducto_descripcion()); } else if(sTipoSeleccionar.equals(ProcesoPreciosPorcentajeConstantesFunciones.LABEL_IDEMPRESA)) { existe=true; procesopreciosporcentajeAux.setsDescripcionGeneralEntityReporte1(procesopreciosporcentajeAux.getempresa_descripcion()); } else if(sTipoSeleccionar.equals(ProcesoPreciosPorcentajeConstantesFunciones.LABEL_IDSUCURSAL)) { existe=true; procesopreciosporcentajeAux.setsDescripcionGeneralEntityReporte1(procesopreciosporcentajeAux.getsucursal_descripcion()); } else if(sTipoSeleccionar.equals(ProcesoPreciosPorcentajeConstantesFunciones.LABEL_IDLINEA)) { existe=true; procesopreciosporcentajeAux.setsDescripcionGeneralEntityReporte1(procesopreciosporcentajeAux.getlinea_descripcion()); } else if(sTipoSeleccionar.equals(ProcesoPreciosPorcentajeConstantesFunciones.LABEL_IDLINEAGRUPO)) { existe=true; procesopreciosporcentajeAux.setsDescripcionGeneralEntityReporte1(procesopreciosporcentajeAux.getlineagrupo_descripcion()); } else if(sTipoSeleccionar.equals(ProcesoPreciosPorcentajeConstantesFunciones.LABEL_IDLINEACATEGORIA)) { existe=true; procesopreciosporcentajeAux.setsDescripcionGeneralEntityReporte1(procesopreciosporcentajeAux.getlineacategoria_descripcion()); } else if(sTipoSeleccionar.equals(ProcesoPreciosPorcentajeConstantesFunciones.LABEL_IDLINEAMARCA)) { existe=true; procesopreciosporcentajeAux.setsDescripcionGeneralEntityReporte1(procesopreciosporcentajeAux.getlineamarca_descripcion()); } else if(sTipoSeleccionar.equals(ProcesoPreciosPorcentajeConstantesFunciones.LABEL_CODIGO)) { existe=true; procesopreciosporcentajeAux.setsDescripcionGeneralEntityReporte1(procesopreciosporcentajeAux.getcodigo()); } else if(sTipoSeleccionar.equals(ProcesoPreciosPorcentajeConstantesFunciones.LABEL_NOMBRE)) { existe=true; procesopreciosporcentajeAux.setsDescripcionGeneralEntityReporte1(procesopreciosporcentajeAux.getnombre()); } else if(sTipoSeleccionar.equals(ProcesoPreciosPorcentajeConstantesFunciones.LABEL_CODIGOPRODUCTO)) { existe=true; procesopreciosporcentajeAux.setsDescripcionGeneralEntityReporte1(procesopreciosporcentajeAux.getcodigo_producto()); } else if(sTipoSeleccionar.equals(ProcesoPreciosPorcentajeConstantesFunciones.LABEL_NOMBREPRODUCTO)) { existe=true; procesopreciosporcentajeAux.setsDescripcionGeneralEntityReporte1(procesopreciosporcentajeAux.getnombre_producto()); } } if(!existe) { JOptionPane.showMessageDialog(this,"NO SE HA SELECCIONADO ALGUNA COLUMNA VALIDA","SELECCIONAR",JOptionPane.ERROR_MESSAGE); } } catch(Exception e) { FuncionesSwing.manageException(this, e,logger,ProcesoPreciosPorcentajeConstantesFunciones.CLASSNAME); } } public void actualizarEstadoCeldasBotonesProcesoPreciosPorcentaje(String sAccion,Boolean isGuardarCambiosEnLote,Boolean isEsMantenimientoRelacionado) throws Exception { if(sAccion=="n") { if(!this.esParaBusquedaForeignKey) { this.isVisibilidadCeldaNuevoProcesoPreciosPorcentaje=true; this.isVisibilidadCeldaNuevoRelacionesProcesoPreciosPorcentaje=true; this.isVisibilidadCeldaGuardarCambiosProcesoPreciosPorcentaje=true; } this.isVisibilidadCeldaModificarProcesoPreciosPorcentaje=false; this.isVisibilidadCeldaActualizarProcesoPreciosPorcentaje=false; this.isVisibilidadCeldaEliminarProcesoPreciosPorcentaje=false; this.isVisibilidadCeldaCancelarProcesoPreciosPorcentaje=false; if(isEsMantenimientoRelacionado==false) { if(isGuardarCambiosEnLote==true) { this.isVisibilidadCeldaGuardarProcesoPreciosPorcentaje=true; } else { this.isVisibilidadCeldaGuardarProcesoPreciosPorcentaje=false; } } } else if(sAccion=="a") { this.isVisibilidadCeldaNuevoProcesoPreciosPorcentaje=false; this.isVisibilidadCeldaNuevoRelacionesProcesoPreciosPorcentaje=false; this.isVisibilidadCeldaGuardarCambiosProcesoPreciosPorcentaje=false; this.isVisibilidadCeldaModificarProcesoPreciosPorcentaje=false; this.isVisibilidadCeldaActualizarProcesoPreciosPorcentaje=true; this.isVisibilidadCeldaEliminarProcesoPreciosPorcentaje=false; this.isVisibilidadCeldaCancelarProcesoPreciosPorcentaje=true; if(isEsMantenimientoRelacionado==false) { if(isGuardarCambiosEnLote==true) { this.isVisibilidadCeldaGuardarProcesoPreciosPorcentaje=true; } else { this.isVisibilidadCeldaGuardarProcesoPreciosPorcentaje=false; } } } else if(sAccion=="ae") { this.isVisibilidadCeldaNuevoProcesoPreciosPorcentaje=false; this.isVisibilidadCeldaNuevoRelacionesProcesoPreciosPorcentaje=false; this.isVisibilidadCeldaGuardarCambiosProcesoPreciosPorcentaje=false; this.isVisibilidadCeldaModificarProcesoPreciosPorcentaje=false; this.isVisibilidadCeldaActualizarProcesoPreciosPorcentaje=true; this.isVisibilidadCeldaEliminarProcesoPreciosPorcentaje=true; this.isVisibilidadCeldaCancelarProcesoPreciosPorcentaje=true; if(isEsMantenimientoRelacionado==false) { if(isGuardarCambiosEnLote==true) { this.isVisibilidadCeldaGuardarProcesoPreciosPorcentaje=true; } else { this.isVisibilidadCeldaGuardarProcesoPreciosPorcentaje=false; } } } //Para Mantenimientos de tablas relacionados con mas de columnas minimas else if(sAccion=="ae2") { this.isVisibilidadCeldaNuevoProcesoPreciosPorcentaje=false; this.isVisibilidadCeldaNuevoRelacionesProcesoPreciosPorcentaje=false; this.isVisibilidadCeldaGuardarCambiosProcesoPreciosPorcentaje=false; this.isVisibilidadCeldaModificarProcesoPreciosPorcentaje=false; this.isVisibilidadCeldaActualizarProcesoPreciosPorcentaje=true; this.isVisibilidadCeldaEliminarProcesoPreciosPorcentaje=false; this.isVisibilidadCeldaCancelarProcesoPreciosPorcentaje=true; if(isEsMantenimientoRelacionado==false) { if(isGuardarCambiosEnLote==true) { this.isVisibilidadCeldaGuardarProcesoPreciosPorcentaje=false; } else { this.isVisibilidadCeldaGuardarProcesoPreciosPorcentaje=false; } } } else if(sAccion=="c") { this.isVisibilidadCeldaNuevoProcesoPreciosPorcentaje=true; this.isVisibilidadCeldaNuevoRelacionesProcesoPreciosPorcentaje=true; this.isVisibilidadCeldaGuardarCambiosProcesoPreciosPorcentaje=true; this.isVisibilidadCeldaModificarProcesoPreciosPorcentaje=false; this.isVisibilidadCeldaActualizarProcesoPreciosPorcentaje=false; this.isVisibilidadCeldaEliminarProcesoPreciosPorcentaje=false; this.isVisibilidadCeldaCancelarProcesoPreciosPorcentaje=false; if(isEsMantenimientoRelacionado==false) { if(isGuardarCambiosEnLote==true) { this.isVisibilidadCeldaGuardarProcesoPreciosPorcentaje=true; } else { this.isVisibilidadCeldaGuardarProcesoPreciosPorcentaje=false; } } } else if(sAccion=="t") { this.isVisibilidadCeldaNuevoProcesoPreciosPorcentaje=false; this.isVisibilidadCeldaNuevoRelacionesProcesoPreciosPorcentaje=false; this.isVisibilidadCeldaGuardarCambiosProcesoPreciosPorcentaje=false; this.isVisibilidadCeldaActualizarProcesoPreciosPorcentaje=false; this.isVisibilidadCeldaEliminarProcesoPreciosPorcentaje=false; this.isVisibilidadCeldaCancelarProcesoPreciosPorcentaje=false; if(isEsMantenimientoRelacionado==false) { if(isGuardarCambiosEnLote==true) { this.isVisibilidadCeldaGuardarProcesoPreciosPorcentaje=false; } else { this.isVisibilidadCeldaGuardarProcesoPreciosPorcentaje=false; } } } else if(sAccion=="s"||sAccion=="s2") { this.isVisibilidadCeldaNuevoProcesoPreciosPorcentaje=false; this.isVisibilidadCeldaNuevoRelacionesProcesoPreciosPorcentaje=false; this.isVisibilidadCeldaGuardarCambiosProcesoPreciosPorcentaje=false; this.isVisibilidadCeldaModificarProcesoPreciosPorcentaje=true; this.isVisibilidadCeldaActualizarProcesoPreciosPorcentaje=false; this.isVisibilidadCeldaEliminarProcesoPreciosPorcentaje=false; this.isVisibilidadCeldaCancelarProcesoPreciosPorcentaje=true; if(isEsMantenimientoRelacionado==false) { if(isGuardarCambiosEnLote==true) { this.isVisibilidadCeldaGuardarProcesoPreciosPorcentaje=false; } else { this.isVisibilidadCeldaGuardarProcesoPreciosPorcentaje=false; } } } //ACTUALIZA VISIBILIDAD PANELES if(ProcesoPreciosPorcentajeJInternalFrame.CON_DATOS_FRAME && !this.esParaBusquedaForeignKey) { //SIEMPRE VISIBLE this.isVisibilidadCeldaNuevoProcesoPreciosPorcentaje=true; this.isVisibilidadCeldaNuevoRelacionesProcesoPreciosPorcentaje=true; this.isVisibilidadCeldaGuardarCambiosProcesoPreciosPorcentaje=true; } else { this.actualizarEstadoPanelsProcesoPreciosPorcentaje(sAccion); } if(this.esParaBusquedaForeignKey) { this.isVisibilidadCeldaCopiarProcesoPreciosPorcentaje=false; //this.isVisibilidadCeldaVerFormProcesoPreciosPorcentaje=false; this.isVisibilidadCeldaDuplicarProcesoPreciosPorcentaje=false; } //SI ES MANTENIMIENTO RELACIONES if(!procesopreciosporcentajeSessionBean.getConGuardarRelaciones()) { this.isVisibilidadCeldaNuevoRelacionesProcesoPreciosPorcentaje=false; } else { this.isVisibilidadCeldaNuevoProcesoPreciosPorcentaje=false; this.isVisibilidadCeldaGuardarCambiosProcesoPreciosPorcentaje=false; } //SI ES MANTENIMIENTO RELACIONADO if(procesopreciosporcentajeSessionBean.getEsGuardarRelacionado()) { if(!procesopreciosporcentajeSessionBean.getConGuardarRelaciones()) { this.isVisibilidadCeldaNuevoRelacionesProcesoPreciosPorcentaje=false; } this.jButtonCerrarProcesoPreciosPorcentaje.setVisible(false); } //SI NO TIENE MAXIMO DE RELACIONES PERMITIDAS if(!this.conMaximoRelaciones) { this.isVisibilidadCeldaNuevoRelacionesProcesoPreciosPorcentaje=false; } if(!this.permiteMantenimiento(this.procesopreciosporcentaje)) { this.isVisibilidadCeldaActualizarProcesoPreciosPorcentaje=false; this.isVisibilidadCeldaEliminarProcesoPreciosPorcentaje=false; } //SE DESHABILITA SIEMPRE this.isVisibilidadCeldaNuevoProcesoPreciosPorcentaje=false; this.isVisibilidadCeldaNuevoRelacionesProcesoPreciosPorcentaje=false; this.isVisibilidadCeldaGuardarCambiosProcesoPreciosPorcentaje=false; //this.isVisibilidadCeldaModificarProcesoPreciosPorcentaje=true; this.isVisibilidadCeldaActualizarProcesoPreciosPorcentaje=false; this.isVisibilidadCeldaEliminarProcesoPreciosPorcentaje=false; //this.isVisibilidadCeldaCancelarProcesoPreciosPorcentaje=true; this.isVisibilidadCeldaGuardarProcesoPreciosPorcentaje=false; } public void actualizarEstadoCeldasBotonesConGuardarRelacionesProcesoPreciosPorcentaje() { } public void actualizarEstadoPanelsProcesoPreciosPorcentaje(String sAccion) { if(sAccion=="n") { if(this.jScrollPanelDatosEdicionProcesoPreciosPorcentaje!=null) { this.jScrollPanelDatosEdicionProcesoPreciosPorcentaje.setVisible(false); } //BYDAN_BUSQUEDAS if(this.jTabbedPaneBusquedasProcesoPreciosPorcentaje!=null) { this.jTabbedPaneBusquedasProcesoPreciosPorcentaje.setVisible(true); } if(this.jScrollPanelDatosProcesoPreciosPorcentaje!=null) { this.jScrollPanelDatosProcesoPreciosPorcentaje.setVisible(true); } if(this.jPanelPaginacionProcesoPreciosPorcentaje!=null) { this.jPanelPaginacionProcesoPreciosPorcentaje.setVisible(true); } if(this.jPanelParametrosReportesProcesoPreciosPorcentaje!=null) { this.jPanelParametrosReportesProcesoPreciosPorcentaje.setVisible(true); } } else if(sAccion=="a") { if(this.jScrollPanelDatosEdicionProcesoPreciosPorcentaje!=null) { this.jScrollPanelDatosEdicionProcesoPreciosPorcentaje.setVisible(true); } //BYDAN_BUSQUEDAS if(this.jTabbedPaneBusquedasProcesoPreciosPorcentaje!=null) { this.jTabbedPaneBusquedasProcesoPreciosPorcentaje.setVisible(false); } if(this.jScrollPanelDatosProcesoPreciosPorcentaje!=null) { this.jScrollPanelDatosProcesoPreciosPorcentaje.setVisible(false); } if(this.jPanelPaginacionProcesoPreciosPorcentaje!=null) { this.jPanelPaginacionProcesoPreciosPorcentaje.setVisible(false); } if(this.jPanelParametrosReportesProcesoPreciosPorcentaje!=null) { this.jPanelParametrosReportesProcesoPreciosPorcentaje.setVisible(false); } } else if(sAccion=="ae") { if(this.jScrollPanelDatosEdicionProcesoPreciosPorcentaje!=null) { this.jScrollPanelDatosEdicionProcesoPreciosPorcentaje.setVisible(true); } //BYDAN_BUSQUEDAS if(this.jTabbedPaneBusquedasProcesoPreciosPorcentaje!=null) { this.jTabbedPaneBusquedasProcesoPreciosPorcentaje.setVisible(false); } if(this.jScrollPanelDatosProcesoPreciosPorcentaje!=null) { this.jScrollPanelDatosProcesoPreciosPorcentaje.setVisible(false); } if(this.jPanelPaginacionProcesoPreciosPorcentaje!=null) { this.jPanelPaginacionProcesoPreciosPorcentaje.setVisible(false); } if(this.jPanelParametrosReportesProcesoPreciosPorcentaje!=null) { this.jPanelParametrosReportesProcesoPreciosPorcentaje.setVisible(false); } } //Para Mantenimientos de tablas relacionados con mas de columnas minimas else if(sAccion=="ae2") { if(this.jScrollPanelDatosEdicionProcesoPreciosPorcentaje!=null) { this.jScrollPanelDatosEdicionProcesoPreciosPorcentaje.setVisible(true); } //BYDAN_BUSQUEDAS if(this.jTabbedPaneBusquedasProcesoPreciosPorcentaje!=null) { this.jTabbedPaneBusquedasProcesoPreciosPorcentaje.setVisible(false); } if(this.jScrollPanelDatosProcesoPreciosPorcentaje!=null) { this.jScrollPanelDatosProcesoPreciosPorcentaje.setVisible(false); } if(this.jPanelPaginacionProcesoPreciosPorcentaje!=null) { this.jPanelPaginacionProcesoPreciosPorcentaje.setVisible(false); } if(this.jPanelParametrosReportesProcesoPreciosPorcentaje!=null) { this.jPanelParametrosReportesProcesoPreciosPorcentaje.setVisible(false); } } else if(sAccion=="c") { if(this.jScrollPanelDatosEdicionProcesoPreciosPorcentaje!=null) { this.jScrollPanelDatosEdicionProcesoPreciosPorcentaje.setVisible(false); } //BYDAN_BUSQUEDAS if(this.jTabbedPaneBusquedasProcesoPreciosPorcentaje!=null) { this.jTabbedPaneBusquedasProcesoPreciosPorcentaje.setVisible(true); } if(this.jScrollPanelDatosProcesoPreciosPorcentaje!=null) { this.jScrollPanelDatosProcesoPreciosPorcentaje.setVisible(true); } if(this.jPanelPaginacionProcesoPreciosPorcentaje!=null) { this.jPanelPaginacionProcesoPreciosPorcentaje.setVisible(true); } if(this.jPanelParametrosReportesProcesoPreciosPorcentaje!=null) { this.jPanelParametrosReportesProcesoPreciosPorcentaje.setVisible(true); } } else if(sAccion=="t") { if(this.jScrollPanelDatosEdicionProcesoPreciosPorcentaje!=null) { this.jScrollPanelDatosEdicionProcesoPreciosPorcentaje.setVisible(false); } //BYDAN_BUSQUEDAS if(this.jTabbedPaneBusquedasProcesoPreciosPorcentaje!=null) { this.jTabbedPaneBusquedasProcesoPreciosPorcentaje.setVisible(true); } if(this.jScrollPanelDatosProcesoPreciosPorcentaje!=null) { this.jScrollPanelDatosProcesoPreciosPorcentaje.setVisible(true); } if(this.jPanelPaginacionProcesoPreciosPorcentaje!=null) { this.jPanelPaginacionProcesoPreciosPorcentaje.setVisible(true); } if(this.jPanelParametrosReportesProcesoPreciosPorcentaje!=null) { this.jPanelParametrosReportesProcesoPreciosPorcentaje.setVisible(true); } } else if(sAccion=="s"||sAccion=="s2") { if(this.jScrollPanelDatosEdicionProcesoPreciosPorcentaje!=null) { this.jScrollPanelDatosEdicionProcesoPreciosPorcentaje.setVisible(false); } //BYDAN_BUSQUEDAS if(this.jTabbedPaneBusquedasProcesoPreciosPorcentaje!=null) { this.jTabbedPaneBusquedasProcesoPreciosPorcentaje.setVisible(true); } if(this.jScrollPanelDatosProcesoPreciosPorcentaje!=null) { this.jScrollPanelDatosProcesoPreciosPorcentaje.setVisible(true); } if(this.jPanelPaginacionProcesoPreciosPorcentaje!=null) { this.jPanelPaginacionProcesoPreciosPorcentaje.setVisible(true); } if(this.jPanelParametrosReportesProcesoPreciosPorcentaje!=null) { this.jPanelParametrosReportesProcesoPreciosPorcentaje.setVisible(true); } } if(sAccion.equals("relacionado") || this.procesopreciosporcentajeSessionBean.getEsGuardarRelacionado()) { if(!this.conCargarMinimo) { //BYDAN_BUSQUEDAS if(this.jTabbedPaneBusquedasProcesoPreciosPorcentaje!=null) { this.jTabbedPaneBusquedasProcesoPreciosPorcentaje.setVisible(false); } } if(this.jPanelParametrosReportesProcesoPreciosPorcentaje!=null) { this.jPanelParametrosReportesProcesoPreciosPorcentaje.setVisible(false); } } else if(sAccion.equals("no_relacionado") && !this.procesopreciosporcentajeSessionBean.getEsGuardarRelacionado()) { //BYDAN_BUSQUEDAS if(this.jTabbedPaneBusquedasProcesoPreciosPorcentaje!=null) { this.jTabbedPaneBusquedasProcesoPreciosPorcentaje.setVisible(true); } if(this.jPanelParametrosReportesProcesoPreciosPorcentaje!=null) { this.jPanelParametrosReportesProcesoPreciosPorcentaje.setVisible(true); } } } public void setVisibilidadBusquedasParaBodega(Boolean isParaBodega){ //BYDAN_BUSQUEDAS if(!this.conCargarMinimo) { Boolean isParaBodegaNegation=!isParaBodega; this.isVisibilidadBusquedaProcesoPreciosPorcentaje=isParaBodega; if(!this.isVisibilidadBusquedaProcesoPreciosPorcentaje) {this.jTabbedPaneBusquedasProcesoPreciosPorcentaje.remove(jPanelBusquedaProcesoPreciosPorcentajeProcesoPreciosPorcentaje);} } } public void setVisibilidadBusquedasParaProducto(Boolean isParaProducto){ //BYDAN_BUSQUEDAS if(!this.conCargarMinimo) { Boolean isParaProductoNegation=!isParaProducto; this.isVisibilidadBusquedaProcesoPreciosPorcentaje=isParaProducto; if(!this.isVisibilidadBusquedaProcesoPreciosPorcentaje) {this.jTabbedPaneBusquedasProcesoPreciosPorcentaje.remove(jPanelBusquedaProcesoPreciosPorcentajeProcesoPreciosPorcentaje);} } } public void setVisibilidadBusquedasParaEmpresa(Boolean isParaEmpresa){ //BYDAN_BUSQUEDAS if(!this.conCargarMinimo) { Boolean isParaEmpresaNegation=!isParaEmpresa; this.isVisibilidadBusquedaProcesoPreciosPorcentaje=isParaEmpresaNegation; if(!this.isVisibilidadBusquedaProcesoPreciosPorcentaje) {this.jTabbedPaneBusquedasProcesoPreciosPorcentaje.remove(jPanelBusquedaProcesoPreciosPorcentajeProcesoPreciosPorcentaje);} } } public void setVisibilidadBusquedasParaSucursal(Boolean isParaSucursal){ //BYDAN_BUSQUEDAS if(!this.conCargarMinimo) { Boolean isParaSucursalNegation=!isParaSucursal; this.isVisibilidadBusquedaProcesoPreciosPorcentaje=isParaSucursalNegation; if(!this.isVisibilidadBusquedaProcesoPreciosPorcentaje) {this.jTabbedPaneBusquedasProcesoPreciosPorcentaje.remove(jPanelBusquedaProcesoPreciosPorcentajeProcesoPreciosPorcentaje);} } } public void setVisibilidadBusquedasParaLinea(Boolean isParaLinea){ //BYDAN_BUSQUEDAS if(!this.conCargarMinimo) { Boolean isParaLineaNegation=!isParaLinea; this.isVisibilidadBusquedaProcesoPreciosPorcentaje=isParaLinea; if(!this.isVisibilidadBusquedaProcesoPreciosPorcentaje) {this.jTabbedPaneBusquedasProcesoPreciosPorcentaje.remove(jPanelBusquedaProcesoPreciosPorcentajeProcesoPreciosPorcentaje);} } } public void setVisibilidadBusquedasParaLineaGrupo(Boolean isParaLineaGrupo){ //BYDAN_BUSQUEDAS if(!this.conCargarMinimo) { Boolean isParaLineaGrupoNegation=!isParaLineaGrupo; this.isVisibilidadBusquedaProcesoPreciosPorcentaje=isParaLineaGrupo; if(!this.isVisibilidadBusquedaProcesoPreciosPorcentaje) {this.jTabbedPaneBusquedasProcesoPreciosPorcentaje.remove(jPanelBusquedaProcesoPreciosPorcentajeProcesoPreciosPorcentaje);} } } public void setVisibilidadBusquedasParaLineaCategoria(Boolean isParaLineaCategoria){ //BYDAN_BUSQUEDAS if(!this.conCargarMinimo) { Boolean isParaLineaCategoriaNegation=!isParaLineaCategoria; this.isVisibilidadBusquedaProcesoPreciosPorcentaje=isParaLineaCategoria; if(!this.isVisibilidadBusquedaProcesoPreciosPorcentaje) {this.jTabbedPaneBusquedasProcesoPreciosPorcentaje.remove(jPanelBusquedaProcesoPreciosPorcentajeProcesoPreciosPorcentaje);} } } public void setVisibilidadBusquedasParaLineaMarca(Boolean isParaLineaMarca){ //BYDAN_BUSQUEDAS if(!this.conCargarMinimo) { Boolean isParaLineaMarcaNegation=!isParaLineaMarca; this.isVisibilidadBusquedaProcesoPreciosPorcentaje=isParaLineaMarca; if(!this.isVisibilidadBusquedaProcesoPreciosPorcentaje) {this.jTabbedPaneBusquedasProcesoPreciosPorcentaje.remove(jPanelBusquedaProcesoPreciosPorcentajeProcesoPreciosPorcentaje);} } } public void guardarDatosBusquedaSession() throws Exception { } public void traerDatosBusquedaDesdeSession() throws Exception { } public void procesoActualizarFilaTotales(Boolean esCampoValor,String sTipo) { try { this.actualizarFilaTotales(); this.traerValoresTablaTotales(); this.inicializarActualizarBindingTablaProcesoPreciosPorcentaje(false); } catch (Exception e) { e.printStackTrace(); } } public void updateBusquedasFormularioProcesoPreciosPorcentaje() { this.updateBorderResaltarBusquedasFormularioProcesoPreciosPorcentaje(); this.updateVisibilidadBusquedasFormularioProcesoPreciosPorcentaje(); this.updateHabilitarBusquedasFormularioProcesoPreciosPorcentaje(); } public void updateBorderResaltarBusquedasFormularioProcesoPreciosPorcentaje() { //BYDAN_BUSQUEDAS int index=0; if(this.jTabbedPaneBusquedasProcesoPreciosPorcentaje.getComponents().length>0) { if(this.procesopreciosporcentajeConstantesFunciones.resaltarBusquedaProcesoPreciosPorcentajeProcesoPreciosPorcentaje!=null) { index= this.jTabbedPaneBusquedasProcesoPreciosPorcentaje.indexOfComponent(this.jPanelBusquedaProcesoPreciosPorcentajeProcesoPreciosPorcentaje); if(index>-1) { JPanel jPanel=(JPanel)this.jTabbedPaneBusquedasProcesoPreciosPorcentaje.getComponent(index); jPanel.setBorder(this.procesopreciosporcentajeConstantesFunciones.resaltarBusquedaProcesoPreciosPorcentajeProcesoPreciosPorcentaje); } } } } public void updateVisibilidadBusquedasFormularioProcesoPreciosPorcentaje() { //BYDAN_BUSQUEDAS int index=0; JPanel jPanel=null; if(this.jTabbedPaneBusquedasProcesoPreciosPorcentaje.getComponents().length>0) { index= this.jTabbedPaneBusquedasProcesoPreciosPorcentaje.indexOfComponent(this.jPanelBusquedaProcesoPreciosPorcentajeProcesoPreciosPorcentaje); jPanel=(JPanel)this.jTabbedPaneBusquedasProcesoPreciosPorcentaje.getComponent(index); //NO VALE SOLO PONIENDO VISIBLE=FALSE, HAY QUE USAR REMOVE jPanel.setVisible(this.procesopreciosporcentajeConstantesFunciones.mostrarBusquedaProcesoPreciosPorcentajeProcesoPreciosPorcentaje); if(!this.procesopreciosporcentajeConstantesFunciones.mostrarBusquedaProcesoPreciosPorcentajeProcesoPreciosPorcentaje && index>-1) { this.jTabbedPaneBusquedasProcesoPreciosPorcentaje.remove(index); } } } public void updateHabilitarBusquedasFormularioProcesoPreciosPorcentaje() { //BYDAN_BUSQUEDAS int index=0; JPanel jPanel=null; if(this.jTabbedPaneBusquedasProcesoPreciosPorcentaje.getComponents().length>0) { index= this.jTabbedPaneBusquedasProcesoPreciosPorcentaje.indexOfComponent(this.jPanelBusquedaProcesoPreciosPorcentajeProcesoPreciosPorcentaje); if(index>-1) { jPanel=(JPanel)this.jTabbedPaneBusquedasProcesoPreciosPorcentaje.getComponent(index); //ENABLE PANE=FALSE NO FUNCIONA, ENABLEAT SI jPanel.setEnabled(this.procesopreciosporcentajeConstantesFunciones.activarBusquedaProcesoPreciosPorcentajeProcesoPreciosPorcentaje); this.jTabbedPaneBusquedasProcesoPreciosPorcentaje.setEnabledAt(index,this.procesopreciosporcentajeConstantesFunciones.activarBusquedaProcesoPreciosPorcentajeProcesoPreciosPorcentaje); } } } public void resaltarPanelBusquedaProcesoPreciosPorcentaje(String sTipoBusqueda) { Boolean existe=false; //BYDAN_BUSQUEDAS int index=0; Border resaltar = Funciones2.getBorderResaltar(this.parametroGeneralUsuario,"TAB"); if(sTipoBusqueda.equals("BusquedaProcesoPreciosPorcentaje")) { index= this.jTabbedPaneBusquedasProcesoPreciosPorcentaje.indexOfComponent(this.jPanelBusquedaProcesoPreciosPorcentajeProcesoPreciosPorcentaje); this.jTabbedPaneBusquedasProcesoPreciosPorcentaje.setSelectedIndex(index); JPanel jPanel=(JPanel)this.jTabbedPaneBusquedasProcesoPreciosPorcentaje.getComponent(index); this.procesopreciosporcentajeConstantesFunciones.setResaltarBusquedaProcesoPreciosPorcentajeProcesoPreciosPorcentaje(resaltar); jPanel.setBorder(this.procesopreciosporcentajeConstantesFunciones.resaltarBusquedaProcesoPreciosPorcentajeProcesoPreciosPorcentaje); existe=true; } if(existe) { this.jTtoolBarProcesoPreciosPorcentaje.setBorder(resaltar); } } //NO FUNCIONA public void windowClosed(WindowEvent e) { } public void windowClosing(WindowEvent e) { } public void windowOpened(WindowEvent e) { } public void windowIconified(WindowEvent e) { } public void windowDeiconified(WindowEvent e) { } public void windowActivated(WindowEvent e) { } public void windowDeactivated(WindowEvent e) { } public void windowGainedFocus(WindowEvent e) { } public void windowLostFocus(WindowEvent e) { } public void updateControlesFormularioProcesoPreciosPorcentaje() throws Exception { if(this.jInternalFrameDetalleFormProcesoPreciosPorcentaje==null) { //if(!this.conCargarFormDetalle) { this.inicializarFormDetalle(); } this.updateBorderResaltarControlesFormularioProcesoPreciosPorcentaje(); this.updateVisibilidadResaltarControlesFormularioProcesoPreciosPorcentaje(); this.updateHabilitarResaltarControlesFormularioProcesoPreciosPorcentaje(); } public void updateBorderResaltarControlesFormularioProcesoPreciosPorcentaje() throws Exception { if(this.jInternalFrameDetalleFormProcesoPreciosPorcentaje==null) { //if(!this.conCargarFormDetalle) { this.inicializarFormDetalle(); } if(this.procesopreciosporcentajeConstantesFunciones.resaltaridProcesoPreciosPorcentaje!=null && this.jInternalFrameDetalleFormProcesoPreciosPorcentaje!=null) {this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jLabelidProcesoPreciosPorcentaje.setBorder(this.procesopreciosporcentajeConstantesFunciones.resaltaridProcesoPreciosPorcentaje);} if(this.procesopreciosporcentajeConstantesFunciones.resaltarid_bodegaProcesoPreciosPorcentaje!=null && this.jInternalFrameDetalleFormProcesoPreciosPorcentaje!=null) {this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jComboBoxid_bodegaProcesoPreciosPorcentaje.setBorder(this.procesopreciosporcentajeConstantesFunciones.resaltarid_bodegaProcesoPreciosPorcentaje);} if(this.procesopreciosporcentajeConstantesFunciones.resaltarid_productoProcesoPreciosPorcentaje!=null && this.jInternalFrameDetalleFormProcesoPreciosPorcentaje!=null) {this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jComboBoxid_productoProcesoPreciosPorcentaje.setBorder(this.procesopreciosporcentajeConstantesFunciones.resaltarid_productoProcesoPreciosPorcentaje);} if(this.procesopreciosporcentajeConstantesFunciones.resaltarid_empresaProcesoPreciosPorcentaje!=null && this.jInternalFrameDetalleFormProcesoPreciosPorcentaje!=null) {this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jComboBoxid_empresaProcesoPreciosPorcentaje.setBorder(this.procesopreciosporcentajeConstantesFunciones.resaltarid_empresaProcesoPreciosPorcentaje);} if(this.procesopreciosporcentajeConstantesFunciones.resaltarid_sucursalProcesoPreciosPorcentaje!=null && this.jInternalFrameDetalleFormProcesoPreciosPorcentaje!=null) {this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jComboBoxid_sucursalProcesoPreciosPorcentaje.setBorder(this.procesopreciosporcentajeConstantesFunciones.resaltarid_sucursalProcesoPreciosPorcentaje);} if(this.procesopreciosporcentajeConstantesFunciones.resaltarid_lineaProcesoPreciosPorcentaje!=null && this.jInternalFrameDetalleFormProcesoPreciosPorcentaje!=null) {this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jComboBoxid_lineaProcesoPreciosPorcentaje.setBorder(this.procesopreciosporcentajeConstantesFunciones.resaltarid_lineaProcesoPreciosPorcentaje);} if(this.procesopreciosporcentajeConstantesFunciones.resaltarid_linea_grupoProcesoPreciosPorcentaje!=null && this.jInternalFrameDetalleFormProcesoPreciosPorcentaje!=null) {this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jComboBoxid_linea_grupoProcesoPreciosPorcentaje.setBorder(this.procesopreciosporcentajeConstantesFunciones.resaltarid_linea_grupoProcesoPreciosPorcentaje);} if(this.procesopreciosporcentajeConstantesFunciones.resaltarid_linea_categoriaProcesoPreciosPorcentaje!=null && this.jInternalFrameDetalleFormProcesoPreciosPorcentaje!=null) {this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jComboBoxid_linea_categoriaProcesoPreciosPorcentaje.setBorder(this.procesopreciosporcentajeConstantesFunciones.resaltarid_linea_categoriaProcesoPreciosPorcentaje);} if(this.procesopreciosporcentajeConstantesFunciones.resaltarid_linea_marcaProcesoPreciosPorcentaje!=null && this.jInternalFrameDetalleFormProcesoPreciosPorcentaje!=null) {this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jComboBoxid_linea_marcaProcesoPreciosPorcentaje.setBorder(this.procesopreciosporcentajeConstantesFunciones.resaltarid_linea_marcaProcesoPreciosPorcentaje);} if(this.procesopreciosporcentajeConstantesFunciones.resaltarcodigoProcesoPreciosPorcentaje!=null && this.jInternalFrameDetalleFormProcesoPreciosPorcentaje!=null) {this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jTextAreacodigoProcesoPreciosPorcentaje.setBorder(this.procesopreciosporcentajeConstantesFunciones.resaltarcodigoProcesoPreciosPorcentaje);} if(this.procesopreciosporcentajeConstantesFunciones.resaltarnombreProcesoPreciosPorcentaje!=null && this.jInternalFrameDetalleFormProcesoPreciosPorcentaje!=null) {this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jTextAreanombreProcesoPreciosPorcentaje.setBorder(this.procesopreciosporcentajeConstantesFunciones.resaltarnombreProcesoPreciosPorcentaje);} if(this.procesopreciosporcentajeConstantesFunciones.resaltarcodigo_productoProcesoPreciosPorcentaje!=null && this.jInternalFrameDetalleFormProcesoPreciosPorcentaje!=null) {this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jTextFieldcodigo_productoProcesoPreciosPorcentaje.setBorder(this.procesopreciosporcentajeConstantesFunciones.resaltarcodigo_productoProcesoPreciosPorcentaje);} if(this.procesopreciosporcentajeConstantesFunciones.resaltarnombre_productoProcesoPreciosPorcentaje!=null && this.jInternalFrameDetalleFormProcesoPreciosPorcentaje!=null) {this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jTextAreanombre_productoProcesoPreciosPorcentaje.setBorder(this.procesopreciosporcentajeConstantesFunciones.resaltarnombre_productoProcesoPreciosPorcentaje);} if(this.procesopreciosporcentajeConstantesFunciones.resaltarprecioProcesoPreciosPorcentaje!=null && this.jInternalFrameDetalleFormProcesoPreciosPorcentaje!=null) {this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jTextFieldprecioProcesoPreciosPorcentaje.setBorder(this.procesopreciosporcentajeConstantesFunciones.resaltarprecioProcesoPreciosPorcentaje);} if(this.procesopreciosporcentajeConstantesFunciones.resaltarporcentajeProcesoPreciosPorcentaje!=null && this.jInternalFrameDetalleFormProcesoPreciosPorcentaje!=null) {this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jTextFieldporcentajeProcesoPreciosPorcentaje.setBorder(this.procesopreciosporcentajeConstantesFunciones.resaltarporcentajeProcesoPreciosPorcentaje);} } public void updateVisibilidadResaltarControlesFormularioProcesoPreciosPorcentaje() throws Exception { if(this.jInternalFrameDetalleFormProcesoPreciosPorcentaje==null) { //if(!this.conCargarFormDetalle) { this.inicializarFormDetalle(); } if(this.jInternalFrameDetalleFormProcesoPreciosPorcentaje!=null) { //this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jLabelidProcesoPreciosPorcentaje.setVisible(this.procesopreciosporcentajeConstantesFunciones.mostraridProcesoPreciosPorcentaje); this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jPanelidProcesoPreciosPorcentaje.setVisible(this.procesopreciosporcentajeConstantesFunciones.mostraridProcesoPreciosPorcentaje); //this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jComboBoxid_bodegaProcesoPreciosPorcentaje.setVisible(this.procesopreciosporcentajeConstantesFunciones.mostrarid_bodegaProcesoPreciosPorcentaje); this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jPanelid_bodegaProcesoPreciosPorcentaje.setVisible(this.procesopreciosporcentajeConstantesFunciones.mostrarid_bodegaProcesoPreciosPorcentaje); //this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jComboBoxid_productoProcesoPreciosPorcentaje.setVisible(this.procesopreciosporcentajeConstantesFunciones.mostrarid_productoProcesoPreciosPorcentaje); this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jPanelid_productoProcesoPreciosPorcentaje.setVisible(this.procesopreciosporcentajeConstantesFunciones.mostrarid_productoProcesoPreciosPorcentaje); //this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jComboBoxid_empresaProcesoPreciosPorcentaje.setVisible(this.procesopreciosporcentajeConstantesFunciones.mostrarid_empresaProcesoPreciosPorcentaje); this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jPanelid_empresaProcesoPreciosPorcentaje.setVisible(this.procesopreciosporcentajeConstantesFunciones.mostrarid_empresaProcesoPreciosPorcentaje); //this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jComboBoxid_sucursalProcesoPreciosPorcentaje.setVisible(this.procesopreciosporcentajeConstantesFunciones.mostrarid_sucursalProcesoPreciosPorcentaje); this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jPanelid_sucursalProcesoPreciosPorcentaje.setVisible(this.procesopreciosporcentajeConstantesFunciones.mostrarid_sucursalProcesoPreciosPorcentaje); //this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jComboBoxid_lineaProcesoPreciosPorcentaje.setVisible(this.procesopreciosporcentajeConstantesFunciones.mostrarid_lineaProcesoPreciosPorcentaje); this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jPanelid_lineaProcesoPreciosPorcentaje.setVisible(this.procesopreciosporcentajeConstantesFunciones.mostrarid_lineaProcesoPreciosPorcentaje); //this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jComboBoxid_linea_grupoProcesoPreciosPorcentaje.setVisible(this.procesopreciosporcentajeConstantesFunciones.mostrarid_linea_grupoProcesoPreciosPorcentaje); this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jPanelid_linea_grupoProcesoPreciosPorcentaje.setVisible(this.procesopreciosporcentajeConstantesFunciones.mostrarid_linea_grupoProcesoPreciosPorcentaje); //this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jComboBoxid_linea_categoriaProcesoPreciosPorcentaje.setVisible(this.procesopreciosporcentajeConstantesFunciones.mostrarid_linea_categoriaProcesoPreciosPorcentaje); this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jPanelid_linea_categoriaProcesoPreciosPorcentaje.setVisible(this.procesopreciosporcentajeConstantesFunciones.mostrarid_linea_categoriaProcesoPreciosPorcentaje); //this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jComboBoxid_linea_marcaProcesoPreciosPorcentaje.setVisible(this.procesopreciosporcentajeConstantesFunciones.mostrarid_linea_marcaProcesoPreciosPorcentaje); this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jPanelid_linea_marcaProcesoPreciosPorcentaje.setVisible(this.procesopreciosporcentajeConstantesFunciones.mostrarid_linea_marcaProcesoPreciosPorcentaje); //this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jTextAreacodigoProcesoPreciosPorcentaje.setVisible(this.procesopreciosporcentajeConstantesFunciones.mostrarcodigoProcesoPreciosPorcentaje); this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jPanelcodigoProcesoPreciosPorcentaje.setVisible(this.procesopreciosporcentajeConstantesFunciones.mostrarcodigoProcesoPreciosPorcentaje); //this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jTextAreanombreProcesoPreciosPorcentaje.setVisible(this.procesopreciosporcentajeConstantesFunciones.mostrarnombreProcesoPreciosPorcentaje); this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jPanelnombreProcesoPreciosPorcentaje.setVisible(this.procesopreciosporcentajeConstantesFunciones.mostrarnombreProcesoPreciosPorcentaje); //this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jTextFieldcodigo_productoProcesoPreciosPorcentaje.setVisible(this.procesopreciosporcentajeConstantesFunciones.mostrarcodigo_productoProcesoPreciosPorcentaje); this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jPanelcodigo_productoProcesoPreciosPorcentaje.setVisible(this.procesopreciosporcentajeConstantesFunciones.mostrarcodigo_productoProcesoPreciosPorcentaje); //this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jTextAreanombre_productoProcesoPreciosPorcentaje.setVisible(this.procesopreciosporcentajeConstantesFunciones.mostrarnombre_productoProcesoPreciosPorcentaje); this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jPanelnombre_productoProcesoPreciosPorcentaje.setVisible(this.procesopreciosporcentajeConstantesFunciones.mostrarnombre_productoProcesoPreciosPorcentaje); //this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jTextFieldprecioProcesoPreciosPorcentaje.setVisible(this.procesopreciosporcentajeConstantesFunciones.mostrarprecioProcesoPreciosPorcentaje); this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jPanelprecioProcesoPreciosPorcentaje.setVisible(this.procesopreciosporcentajeConstantesFunciones.mostrarprecioProcesoPreciosPorcentaje); //this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jTextFieldporcentajeProcesoPreciosPorcentaje.setVisible(this.procesopreciosporcentajeConstantesFunciones.mostrarporcentajeProcesoPreciosPorcentaje); this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jPanelporcentajeProcesoPreciosPorcentaje.setVisible(this.procesopreciosporcentajeConstantesFunciones.mostrarporcentajeProcesoPreciosPorcentaje); } } public void updateHabilitarResaltarControlesFormularioProcesoPreciosPorcentaje() throws Exception { if(this.jInternalFrameDetalleFormProcesoPreciosPorcentaje==null) { //if(!this.conCargarFormDetalle) { this.inicializarFormDetalle(); } if(this.jInternalFrameDetalleFormProcesoPreciosPorcentaje!=null) { this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jLabelidProcesoPreciosPorcentaje.setEnabled(this.procesopreciosporcentajeConstantesFunciones.activaridProcesoPreciosPorcentaje); this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jComboBoxid_bodegaProcesoPreciosPorcentaje.setEnabled(this.procesopreciosporcentajeConstantesFunciones.activarid_bodegaProcesoPreciosPorcentaje); this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jComboBoxid_productoProcesoPreciosPorcentaje.setEnabled(this.procesopreciosporcentajeConstantesFunciones.activarid_productoProcesoPreciosPorcentaje); this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jComboBoxid_empresaProcesoPreciosPorcentaje.setEnabled(this.procesopreciosporcentajeConstantesFunciones.activarid_empresaProcesoPreciosPorcentaje); this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jComboBoxid_sucursalProcesoPreciosPorcentaje.setEnabled(this.procesopreciosporcentajeConstantesFunciones.activarid_sucursalProcesoPreciosPorcentaje); this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jComboBoxid_lineaProcesoPreciosPorcentaje.setEnabled(this.procesopreciosporcentajeConstantesFunciones.activarid_lineaProcesoPreciosPorcentaje); this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jComboBoxid_linea_grupoProcesoPreciosPorcentaje.setEnabled(this.procesopreciosporcentajeConstantesFunciones.activarid_linea_grupoProcesoPreciosPorcentaje); this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jComboBoxid_linea_categoriaProcesoPreciosPorcentaje.setEnabled(this.procesopreciosporcentajeConstantesFunciones.activarid_linea_categoriaProcesoPreciosPorcentaje); this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jComboBoxid_linea_marcaProcesoPreciosPorcentaje.setEnabled(this.procesopreciosporcentajeConstantesFunciones.activarid_linea_marcaProcesoPreciosPorcentaje); this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jTextAreacodigoProcesoPreciosPorcentaje.setEnabled(this.procesopreciosporcentajeConstantesFunciones.activarcodigoProcesoPreciosPorcentaje); this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jTextAreanombreProcesoPreciosPorcentaje.setEnabled(this.procesopreciosporcentajeConstantesFunciones.activarnombreProcesoPreciosPorcentaje); this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jTextFieldcodigo_productoProcesoPreciosPorcentaje.setEnabled(this.procesopreciosporcentajeConstantesFunciones.activarcodigo_productoProcesoPreciosPorcentaje); this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jTextAreanombre_productoProcesoPreciosPorcentaje.setEnabled(this.procesopreciosporcentajeConstantesFunciones.activarnombre_productoProcesoPreciosPorcentaje); this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jTextFieldprecioProcesoPreciosPorcentaje.setEnabled(this.procesopreciosporcentajeConstantesFunciones.activarprecioProcesoPreciosPorcentaje); this.jInternalFrameDetalleFormProcesoPreciosPorcentaje.jTextFieldporcentajeProcesoPreciosPorcentaje.setEnabled(this.procesopreciosporcentajeConstantesFunciones.activarporcentajeProcesoPreciosPorcentaje); } } }
42.843553
611
0.783516
c575744dbab257d50aca2bff3ce9c0936f8f04ab
6,986
/** * Copyright (C) 2015 The Gravitee team (http://gravitee.io) * * Licensed 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. */ package io.gravitee.management.rest.resource; import io.gravitee.management.rest.JerseySpringTest; import io.gravitee.management.security.authentication.AuthenticationProvider; import io.gravitee.management.security.authentication.AuthenticationProviderManager; import io.gravitee.management.security.cookies.JWTCookieGenerator; import io.gravitee.management.service.*; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.PropertySource; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.test.context.support.AnnotationConfigContextLoader; import java.util.Collections; import java.util.List; import java.util.Optional; import static org.mockito.Mockito.mock; /** * @author David BRASSELY (david.brassely at graviteesource.com) * @author Nicolas GERAUD (nicolas.geraud at graviteesource.com) */ @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(loader=AnnotationConfigContextLoader.class) public abstract class AbstractResourceTest extends JerseySpringTest { public AbstractResourceTest() { super(new AuthenticationProviderManager() { @Override public List<AuthenticationProvider> getIdentityProviders() { return Collections.emptyList(); } @Override public Optional<AuthenticationProvider> findIdentityProviderByType(String type) { return Optional.empty(); } }); } public AbstractResourceTest(AuthenticationProviderManager authenticationProviderManager) { super(authenticationProviderManager); } @Autowired protected ApiService apiService; @Autowired protected ApplicationService applicationService; @Autowired protected PolicyService policyService; @Autowired protected UserService userService; @Autowired protected FetcherService fetcherService; @Autowired protected SwaggerService swaggerService; @Autowired protected MembershipService membershipService; @Autowired protected RoleService roleService; @Autowired @Qualifier("oauth2") protected AuthenticationProvider authenticationProvider; @Autowired protected PageService pageService; @Autowired protected GroupService groupService; @Autowired protected RatingService ratingService; @Autowired protected PermissionService permissionService; @Autowired protected NotifierService notifierService; @Autowired protected QualityMetricsService qualityMetricsService; @Autowired protected MessageService messageService; @Autowired protected SocialIdentityProviderService socialIdentityProviderService; @Autowired protected TagService tagService; @Autowired protected ParameterService parameterService; @Autowired protected VirtualHostService virtualHostService; @Configuration @PropertySource("classpath:/io/gravitee/management/rest/resource/jwt.properties") static class ContextConfiguration { @Bean public ApiService apiService() { return mock(ApiService.class); } @Bean public ApplicationService applicationService() { return mock(ApplicationService.class); } @Bean public UserService userService() { return mock(UserService.class); } @Bean public PolicyService policyService() { return mock(PolicyService.class); } @Bean public FetcherService fetcherService() { return mock(FetcherService.class); } @Bean public SwaggerService swaggerService() { return mock(SwaggerService.class); } @Bean public MembershipService membershipService() { return mock(MembershipService.class); } @Bean public RoleService roleService() { return mock(RoleService.class); } @Bean("oauth2") public AuthenticationProvider authenticationProvider() { return mock(AuthenticationProvider.class); } @Bean public PageService pageService() { return mock(PageService.class); } @Bean public GroupService groupService() { return mock(GroupService.class); } @Bean public RatingService ratingService() { return mock(RatingService.class); } @Bean public PermissionService permissionService() { return mock(PermissionService.class); } @Bean public NotifierService notifierService() { return mock(NotifierService.class); } @Bean public TopApiService topApiService() { return mock(TopApiService.class); } @Bean public JWTCookieGenerator jwtCookieGenerator() { return mock(JWTCookieGenerator.class); } @Bean public TaskService taskService() { return mock(TaskService.class); } @Bean public QualityMetricsService qualityMetricsService() { return mock(QualityMetricsService.class); } @Bean public MessageService messageService() { return mock(MessageService.class); } @Bean public SocialIdentityProviderService socialIdentityProviderService() { return mock(SocialIdentityProviderService.class); } @Bean public TagService tagService() { return mock(TagService.class); } @Bean public MediaService mediaService() { return mock(MediaService.class); } @Bean public ParameterService parameterService() { return mock(ParameterService.class); } @Bean public VirtualHostService virtualHostService() { return mock(VirtualHostService.class); } } }
27.832669
94
0.68308
6bf66b3983df60900fd8d7bfcec2810b4d6f377c
169
package com.amore.designtenet.srp; //接口拆分:对职责进行解耦 public interface ICourseInfo { //获取基本信息 String getCourseName(); //获得视屏流 byte[] getCourseVideo(); }
13
34
0.674556
2ccb6895ca6a5bcb5390b26ead44bf19913ab275
1,881
/* * File: ContactRepositoryCustom.java * Creation Date: Jul 8, 2021 * * Copyright (c) 2021 T.N.Silverman - all rights reserved * * 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. */ package com.tnsilver.contacts.repository; import java.time.LocalDate; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; import com.tnsilver.contacts.model.Contact; /** * A custom repository interface for {@link Contact} hashes to augment functionality not possible on Redis with * standard SDR generated repositories such as {@link ContactRepository}. * * @author T.N.Silverman * */ public interface ContactRepositoryCustom /*extends QueryByExampleExecutor<Contact> */{ Page<Contact> getByExample(Contact probe, Pageable pageable); Page<Contact> getByParams(String ssn, String firstName, String lastName, LocalDate birthDate, Boolean married, Integer children, Pageable pageable); public <S extends Contact> S update(S contact); }
36.173077
111
0.704944
f4b75240cd36fee591a16f11b09209a109d68485
804
package org.parctice.app.hackerrank.java.introduction; import java.util.Scanner; public class OutputFormating { public static void main(String[] args) { Scanner sc=new Scanner(System.in); System.out.println("================================"); for(int i=0;i<3;i++){ String s1=sc.next(); int x=sc.nextInt(); System.out.println(getLeftAlignedTextWith15Spaces(s1) .concat(getNumberWithPreceedingZeros(x))); } System.out.println("================================"); } private static String getLeftAlignedTextWith15Spaces(String in){ return String.format("%-15s", in); } private static String getNumberWithPreceedingZeros(int in){ return String.format("%03d", in); } }
30.923077
68
0.570896
9cfb1b35fe1cb0b4570af69d2fa8e992f4b3c86c
21,110
package pro.taskana.impl; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import org.apache.ibatis.exceptions.PersistenceException; import org.apache.ibatis.session.RowBounds; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import pro.taskana.ClassificationQuery; import pro.taskana.ClassificationSummary; import pro.taskana.ClassificationQueryColumnName; import pro.taskana.TaskanaEngine; import pro.taskana.TimeInterval; import pro.taskana.exceptions.InvalidArgumentException; import pro.taskana.exceptions.TaskanaRuntimeException; import pro.taskana.impl.util.LoggerUtils; /** * Implementation of ClassificationQuery interface. * * @author EH */ public class ClassificationQueryImpl implements ClassificationQuery { private static final String LINK_TO_SUMMARYMAPPER = "pro.taskana.mappings.QueryMapper.queryClassificationSummaries"; private static final String LINK_TO_COUNTER = "pro.taskana.mappings.QueryMapper.countQueryClassifications"; private static final String LINK_TO_VALUEMAPPER = "pro.taskana.mappings.QueryMapper.queryClassificationColumnValues"; private static final Logger LOGGER = LoggerFactory.getLogger(ClassificationQueryImpl.class); private TaskanaEngineImpl taskanaEngine; private ClassificationQueryColumnName columnName; private String[] key; private String[] idIn; private String[] parentId; private String[] parentKey; private String[] category; private String[] type; private String[] domain; private Boolean validInDomain; private TimeInterval[] createdIn; private TimeInterval[] modifiedIn; private String[] nameIn; private String[] nameLike; private String descriptionLike; private int[] priority; private String[] serviceLevelIn; private String[] serviceLevelLike; private String[] applicationEntryPointIn; private String[] applicationEntryPointLike; private String[] custom1In; private String[] custom1Like; private String[] custom2In; private String[] custom2Like; private String[] custom3In; private String[] custom3Like; private String[] custom4In; private String[] custom4Like; private String[] custom5In; private String[] custom5Like; private String[] custom6In; private String[] custom6Like; private String[] custom7In; private String[] custom7Like; private String[] custom8In; private String[] custom8Like; private List<String> orderBy; private List<String> orderColumns; ClassificationQueryImpl(TaskanaEngine taskanaEngine) { this.taskanaEngine = (TaskanaEngineImpl) taskanaEngine; this.orderBy = new ArrayList<>(); this.orderColumns = new ArrayList<>(); } @Override public ClassificationQuery keyIn(String... key) { this.key = key; return this; } @Override public ClassificationQuery idIn(String... id) { this.idIn = id; return this; } @Override public ClassificationQuery parentIdIn(String... parentId) { this.parentId = parentId; return this; } @Override public ClassificationQuery parentKeyIn(String... parentKey) { this.parentKey = parentKey; return this; } @Override public ClassificationQuery categoryIn(String... category) { this.category = category; return this; } @Override public ClassificationQuery typeIn(String... type) { this.type = type; return this; } @Override public ClassificationQuery domainIn(String... domain) { this.domain = domain; return this; } @Override public ClassificationQuery validInDomainEquals(Boolean validInDomain) { this.validInDomain = validInDomain; return this; } @Override public ClassificationQuery createdWithin(TimeInterval... createdIn) { this.createdIn = createdIn; for (TimeInterval ti : createdIn) { if (!ti.isValid()) { throw new IllegalArgumentException("TimeInterval " + ti + " is invalid."); } } return this; } @Override public ClassificationQuery modifiedWithin(TimeInterval... modifiedIn) { this.modifiedIn = modifiedIn; for (TimeInterval ti : modifiedIn) { if (!ti.isValid()) { throw new IllegalArgumentException("TimeInterval " + ti + " is invalid."); } } return this; } @Override public ClassificationQuery nameIn(String... nameIn) { this.nameIn = nameIn; return this; } @Override public ClassificationQuery nameLike(String... nameLike) { this.nameLike = toUpperCopy(nameLike); return this; } @Override public ClassificationQuery descriptionLike(String description) { this.descriptionLike = description.toUpperCase(); return this; } @Override public ClassificationQuery priorityIn(int... priorities) { this.priority = priorities; return this; } @Override public ClassificationQuery serviceLevelIn(String... serviceLevelIn) { this.serviceLevelIn = serviceLevelIn; return this; } @Override public ClassificationQuery serviceLevelLike(String... serviceLevelLike) { this.serviceLevelLike = toUpperCopy(serviceLevelLike); return this; } @Override public ClassificationQuery applicationEntryPointIn(String... applicationEntryPointIn) { this.applicationEntryPointIn = applicationEntryPointIn; return this; } @Override public ClassificationQuery applicationEntryPointLike(String... applicationEntryPointLike) { this.applicationEntryPointLike = toUpperCopy(applicationEntryPointLike); return this; } @Override public ClassificationQuery customAttributeIn(String number, String... customIn) throws InvalidArgumentException { int num = 0; try { num = Integer.parseInt(number); } catch (NumberFormatException e) { throw new InvalidArgumentException( "Argument '" + number + "' to getCustomAttribute cannot be converted to a number between 1 and 8", e.getCause()); } if (customIn.length == 0) { throw new InvalidArgumentException( "At least one string has to be provided as a search parameter"); } switch (num) { case 1: this.custom1In = customIn; break; case 2: this.custom2In = customIn; break; case 3: this.custom3In = customIn; break; case 4: this.custom4In = customIn; break; case 5: this.custom5In = customIn; break; case 6: this.custom6In = customIn; break; case 7: this.custom7In = customIn; break; case 8: this.custom8In = customIn; break; default: throw new InvalidArgumentException( "Argument '" + number + "' to getCustomAttribute does not represent a number between 1 and 8"); } return this; } @Override public ClassificationQuery customAttributeLike(String number, String... customLike) throws InvalidArgumentException { int num = 0; try { num = Integer.parseInt(number); } catch (NumberFormatException e) { throw new InvalidArgumentException( "Argument '" + number + "' to getCustomAttribute cannot be converted to a number between 1 and 16", e.getCause()); } if (customLike.length == 0) { throw new InvalidArgumentException( "At least one string has to be provided as a search parameter"); } switch (num) { case 1: this.custom1Like = toUpperCopy(customLike); break; case 2: this.custom2Like = toUpperCopy(customLike); break; case 3: this.custom3Like = toUpperCopy(customLike); break; case 4: this.custom4Like = toUpperCopy(customLike); break; case 5: this.custom5Like = toUpperCopy(customLike); break; case 6: this.custom6Like = toUpperCopy(customLike); break; case 7: this.custom7Like = toUpperCopy(customLike); break; case 8: this.custom8Like = toUpperCopy(customLike); break; default: throw new InvalidArgumentException( "Argument '" + number + "' to getCustomAttribute does not represent a number between 1 and 16"); } return this; } @Override public ClassificationQuery orderByKey(SortDirection sortDirection) { return addOrderCriteria("KEY", sortDirection); } @Override public ClassificationQuery orderByParentId(SortDirection sortDirection) { return addOrderCriteria("PARENT_ID", sortDirection); } @Override public ClassificationQuery orderByParentKey(SortDirection sortDirection) { return addOrderCriteria("PARENT_KEY", sortDirection); } @Override public ClassificationQuery orderByCategory(SortDirection sortDirection) { return addOrderCriteria("CATEGORY", sortDirection); } @Override public ClassificationQuery orderByDomain(SortDirection sortDirection) { return addOrderCriteria("DOMAIN", sortDirection); } @Override public ClassificationQuery orderByPriority(SortDirection sortDirection) { return addOrderCriteria("PRIORITY", sortDirection); } @Override public ClassificationQuery orderByName(SortDirection sortDirection) { return addOrderCriteria("NAME", sortDirection); } @Override public ClassificationQuery orderByServiceLevel(SortDirection sortDirection) { return addOrderCriteria("SERVICE_LEVEL", sortDirection); } @Override public ClassificationQuery orderByApplicationEntryPoint(SortDirection sortDirection) { return addOrderCriteria("APPLICATION_ENTRY_POINT", sortDirection); } @Override public ClassificationQuery orderByCustomAttribute(String number, SortDirection sortDirection) throws InvalidArgumentException { int num = 0; try { num = Integer.parseInt(number); } catch (NumberFormatException e) { throw new InvalidArgumentException( "Argument '" + number + "' to getCustomAttribute cannot be converted to a number between 1 and 16", e.getCause()); } switch (num) { case 1: return addOrderCriteria("CUSTOM_1", sortDirection); case 2: return addOrderCriteria("CUSTOM_2", sortDirection); case 3: return addOrderCriteria("CUSTOM_3", sortDirection); case 4: return addOrderCriteria("CUSTOM_4", sortDirection); case 5: return addOrderCriteria("CUSTOM_5", sortDirection); case 6: return addOrderCriteria("CUSTOM_6", sortDirection); case 7: return addOrderCriteria("CUSTOM_7", sortDirection); case 8: return addOrderCriteria("CUSTOM_8", sortDirection); default: throw new InvalidArgumentException( "Argument '" + number + "' to getCustomAttribute does not represent a number between 1 and 16"); } } @Override public List<ClassificationSummary> list() { LOGGER.debug("entry to list(), this = {}", this); List<ClassificationSummary> result = new ArrayList<>(); try { taskanaEngine.openConnection(); result = taskanaEngine.getSqlSession().selectList(LINK_TO_SUMMARYMAPPER, this); return result; } finally { taskanaEngine.returnConnection(); if (LOGGER.isDebugEnabled()) { LOGGER.debug("exit from list(). Returning {} resulting Objects: {} ", result.size(), LoggerUtils.listToString(result)); } } } @Override public List<ClassificationSummary> list(int offset, int limit) { LOGGER.debug("entry to list(offset = {}, limit = {}), this = {}", offset, limit, this); List<ClassificationSummary> result = new ArrayList<>(); try { taskanaEngine.openConnection(); RowBounds rowBounds = new RowBounds(offset, limit); result = taskanaEngine.getSqlSession().selectList(LINK_TO_SUMMARYMAPPER, this, rowBounds); return result; } catch (Exception e) { if (e instanceof PersistenceException) { if (e.getMessage().contains("ERRORCODE=-4470")) { TaskanaRuntimeException ex = new TaskanaRuntimeException( "The offset beginning was set over the amount of result-rows.", e.getCause()); ex.setStackTrace(e.getStackTrace()); throw ex; } } throw e; } finally { taskanaEngine.returnConnection(); if (LOGGER.isDebugEnabled()) { LOGGER.debug("exit from list(offset,limit). Returning {} resulting Objects: {} ", result.size(), LoggerUtils.listToString(result)); } } } @Override public List<String> listValues(ClassificationQueryColumnName columnName, SortDirection sortDirection) { LOGGER.debug("Entry to listValues(dbColumnName={}) this = {}", columnName, this); List<String> result = new ArrayList<>(); try { taskanaEngine.openConnection(); this.columnName = columnName; this.orderBy.clear(); this.addOrderCriteria(columnName.toString(), sortDirection); result = taskanaEngine.getSqlSession().selectList(LINK_TO_VALUEMAPPER, this); return result; } finally { taskanaEngine.returnConnection(); if (LOGGER.isDebugEnabled()) { LOGGER.debug("Exit from listValues. Returning {} resulting Objects: {} ", result.size(), LoggerUtils.listToString(result)); } } } @Override public ClassificationSummary single() { LOGGER.debug("entry to single(), this = {}", this); ClassificationSummary result = null; try { taskanaEngine.openConnection(); result = taskanaEngine.getSqlSession().selectOne(LINK_TO_SUMMARYMAPPER, this); return result; } finally { taskanaEngine.returnConnection(); LOGGER.debug("exit from single(). Returning result {} ", result); } } @Override public long count() { LOGGER.debug("entry to count(), this = {}", this); Long rowCount = null; try { taskanaEngine.openConnection(); rowCount = taskanaEngine.getSqlSession().selectOne(LINK_TO_COUNTER, this); return (rowCount == null) ? 0L : rowCount; } finally { taskanaEngine.returnConnection(); LOGGER.debug("exit from count(). Returning result {} ", rowCount); } } private ClassificationQuery addOrderCriteria(String columnName, SortDirection sortDirection) { String orderByDirection = " " + (sortDirection == null ? SortDirection.ASCENDING : sortDirection); orderBy.add(columnName.toString() + orderByDirection); orderColumns.add(columnName.toString()); return this; } public String[] getKey() { return key; } public String[] getIdIn() { return idIn; } public String[] getparentId() { return parentId; } public String[] getparentKey() { return parentKey; } public String[] getCategory() { return category; } public String[] getType() { return type; } public String[] getNameIn() { return nameIn; } public String[] getNameLike() { return nameLike; } public String getDescriptionLike() { return descriptionLike; } public int[] getPriority() { return priority; } public String[] getServiceLevelIn() { return serviceLevelIn; } public String[] getServiceLevelLike() { return serviceLevelLike; } public String[] getDomain() { return domain; } public Boolean getValidInDomain() { return validInDomain; } public TimeInterval[] getCreatedIn() { return createdIn; } public TimeInterval[] getModifiedIn() { return modifiedIn; } public String[] getApplicationEntryPointIn() { return applicationEntryPointIn; } public String[] getApplicationEntryPointLike() { return applicationEntryPointLike; } public String[] getCustom1In() { return custom1In; } public String[] getCustom1Like() { return custom1Like; } public String[] getCustom2In() { return custom2In; } public String[] getCustom2Like() { return custom2Like; } public String[] getCustom3In() { return custom3In; } public String[] getCustom3Like() { return custom3Like; } public String[] getCustom4In() { return custom4In; } public String[] getCustom4Like() { return custom4Like; } public String[] getCustom5In() { return custom5In; } public String[] getCustom5Like() { return custom5Like; } public String[] getCustom6In() { return custom6In; } public String[] getCustom6Like() { return custom6Like; } public String[] getCustom7In() { return custom7In; } public String[] getCustom7Like() { return custom7Like; } public String[] getCustom8In() { return custom8In; } public String[] getCustom8Like() { return custom8Like; } public ClassificationQueryColumnName getColumnName() { return columnName; } public List<String> getOrderBy() { return orderBy; } public List<String> getOrderColumns() { return orderColumns; } @Override public String toString() { return "ClassificationQueryImpl [" + "columnName= " + this.columnName + ", key= " + Arrays.toString(this.key) + ", idIn= " + Arrays.toString(this.idIn) + ", parentId= " + Arrays.toString(this.parentId) + ", parentKey= " + Arrays.toString(this.parentKey) + ", category= " + Arrays.toString(this.category) + ", type= " + Arrays.toString(this.type) + ", domain= " + Arrays.toString(this.domain) + ", validInDomain= " + this.validInDomain + ", createdIn= " + Arrays.toString(this.createdIn) + ", modifiedIn= " + Arrays.toString(this.modifiedIn) + ", nameIn= " + Arrays.toString(this.nameIn) + ", nameLike= " + Arrays.toString(this.nameLike) + ", descriptionLike= " + this.descriptionLike + ", priority= " + Arrays.toString(this.priority) + ", serviceLevelIn= " + Arrays.toString(this.serviceLevelIn) + ", serviceLevelLike= " + Arrays.toString(this.serviceLevelLike) + ", applicationEntryPointIn= " + Arrays.toString(this.applicationEntryPointIn) + ", applicationEntryPointLike= " + Arrays.toString(this.applicationEntryPointLike) + ", custom1In= " + Arrays.toString(this.custom1In) + ", custom1Like= " + Arrays.toString(this.custom1Like) + ", custom2In= " + Arrays.toString(this.custom2In) + ", custom2Like= " + Arrays.toString(this.custom2Like) + ", custom3In= " + Arrays.toString(this.custom3In) + ", custom3Like= " + Arrays.toString(this.custom3Like) + ", custom4In= " + Arrays.toString(this.custom4In) + ", custom4Like= " + Arrays.toString(this.custom4Like) + ", custom5In= " + Arrays.toString(this.custom5In) + ", custom5Like= " + Arrays.toString(this.custom5Like) + ", custom6In= " + Arrays.toString(this.custom6In) + ", custom6Like= " + Arrays.toString(this.custom6Like) + ", custom7In= " + Arrays.toString(this.custom7In) + ", custom7Like= " + Arrays.toString(this.custom7Like) + ", custom8In= " + Arrays.toString(this.custom8In) + ", custom8Like= " + Arrays.toString(this.custom8Like) + ", orderBy= " + this.orderBy + "]"; } }
32.830482
131
0.613501
52d3ced87a4088fb19ebe34db6b7eba8603854d0
4,029
package com.alibaba.ydt.portal.web.mvc; import com.alibaba.ydt.portal.util.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.springframework.web.servlet.view.AbstractUrlBasedView; import org.springframework.web.servlet.view.velocity.VelocityLayoutView; import org.springframework.web.servlet.view.velocity.VelocityLayoutViewResolver; import java.util.HashMap; import java.util.Map; /** * <p> * 支持多个 layout 映射的视图解析器 * </p> * Time: 12-7-30 下午1:46 * * @author <a href="mailto:huangfengjing@gmail.com">Ivan</a> * @version 1.0 */ public class MultipleVelocityLayoutViewResolver extends VelocityLayoutViewResolver { private static final Log logger = LogFactory.getLog(MultipleVelocityLayoutViewResolver.class); private Map<String, String> mappings = new HashMap<String, String>(); private String layoutKey; private String screenContentKey; /** * Requires VelocityLayoutView. * * @see org.springframework.web.servlet.view.velocity.VelocityLayoutView */ protected Class<?> requiredViewClass() { return VelocityLayoutView.class; } /** * Set the context key used to specify an alternate layout to be used instead * of the default layout. Screen content templates can override the layout * template that they wish to be wrapped with by setting this value in the * template, for example:<br> * <code>#set( $layout = "MyLayout.vm" )</code> * <p>The default key is "layout", as illustrated above. * * @param layoutKey the name of the key you wish to use in your * screen content templates to override the layout template * @see org.springframework.web.servlet.view.velocity.VelocityLayoutView#setLayoutKey */ public void setLayoutKey(final String layoutKey) { this.layoutKey = layoutKey; } /** * Set the name of the context key that will hold the content of * the screen within the layout template. This key must be present * in the layout template for the current screen to be rendered. * <p>Default is "screen_content": accessed in VTL as * <code>$screen_content</code>. * * @param screenContentKey the name of the screen content key to use * @see org.springframework.web.servlet.view.velocity.VelocityLayoutView#setScreenContentKey */ public void setScreenContentKey(final String screenContentKey) { this.screenContentKey = screenContentKey; } protected AbstractUrlBasedView buildView(final String viewName) throws Exception { if (logger.isDebugEnabled()) { logger.debug("Building view using multiple layout resolver. View name is " + viewName); } VelocityLayoutView view = (VelocityLayoutView) super.buildView(viewName); if (this.layoutKey != null) { view.setLayoutKey(this.layoutKey); } if (this.screenContentKey != null) { view.setScreenContentKey(this.screenContentKey); } if (!this.mappings.isEmpty()) { for (Map.Entry<String, String> entry : this.mappings.entrySet()) { // Correct wildcards so that we can use the matches method in the String object String mappingRegexp = StringUtils.replace(entry.getKey(), "*", ".*"); // If the view matches the regexp mapping String tmp = viewName; if(tmp.startsWith("/")) { tmp = tmp.substring(1); } if (tmp.matches(mappingRegexp)) { if (logger.isDebugEnabled()) logger.debug(" Found matching view. Setting layout url to " + entry.getValue()); view.setLayoutUrl(entry.getValue()); return view; } } } return view; } public void setMappings(Map<String, String> mappings) { this.mappings = mappings; } }
35.973214
105
0.652271
218f0c76a9b98c751fbbc7edd65523a8439ec558
5,640
package tw.com.maxkit.miniweb.business; import java.util.Arrays; import java.util.List; import org.springframework.http.HttpEntity; import org.springframework.http.HttpHeaders; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Service; import org.springframework.util.LinkedMultiValueMap; import org.springframework.util.MultiValueMap; import org.springframework.web.client.RestTemplate; import tw.com.maxkit.miniweb.bean.ApiIn; import tw.com.maxkit.miniweb.bean.ApiOut; import tw.com.maxkit.miniweb.bean.Body; import tw.com.maxkit.miniweb.bean.Imgbody; import tw.com.maxkit.miniweb.bean.checkin.Checkin; import tw.com.maxkit.miniweb.common.CommonBusiness; import tw.com.maxkit.miniweb.utils.DataUtils; @Service public class CheckinBusiness extends CommonBusiness { private final String API_CHECKIN = "http://localhost:8080/ivrdatasource/checkin/checkinNow"; private final String API_CHECKOUT = "http://localhost:8080/ivrdatasource/checkin/checkoutNow"; private final String API_HISTORY = "http://localhost:8080/ivrdatasource/checkin/history"; public ApiOut requestHandler(ApiIn apiIn) { String pagename = apiIn.getPagename(); ApiOut apiOut = new ApiOut(); switch (pagename) { case "home": apiOut = homeHandler(apiIn, apiOut); break; case "checkin": apiOut = checkinHandler(apiIn, apiOut); break; case "checkout": apiOut = checkoutHandler(apiIn, apiOut); break; case "history": apiOut = historyHandler(apiIn, apiOut); break; default: break; } return apiOut; } private ApiOut homeHandler(ApiIn apiIn, ApiOut apiOut) { String imgdata = ""; try { imgdata = DataUtils.getPics64img(context, "checkin_home"); } catch (Exception e) { logger.error("Exception:", e); } Body bodyImg = new Body(); bodyImg.setType("img"); bodyImg.setImgid("homepic"); Body bodyDesc = new Body(); bodyDesc.setType("span"); bodyDesc.setValue("透過簽到小程式,可以讓您使用 Kokola 簽到與查詢簽到記錄。"); Imgbody imgbody = new Imgbody(); imgbody.setImgid("homepic"); imgbody.setImgdata(imgdata); apiOut.setRcode("200"); apiOut.setRdesc("ok"); apiOut.setPagename("home"); apiOut.setBody(Arrays.asList(bodyImg, bodyDesc)); apiOut.setImgbody(Arrays.asList(imgbody)); return apiOut; } private ApiOut checkinHandler(ApiIn apiIn, ApiOut apiOut) { String userid = apiIn.getUserid(); // query crm raw data RestTemplate restTemplate = new RestTemplate(); HttpHeaders headers = new HttpHeaders(); headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED); MultiValueMap<String, String> map = new LinkedMultiValueMap<>(); map.add("userid", userid); HttpEntity<MultiValueMap<String, String>> request = new HttpEntity<>(map, headers); ResponseEntity<Integer> response= restTemplate.postForEntity(API_CHECKIN, request, Integer.class); Integer rcode = response.getBody(); logger.debug("rcode = {}", rcode); Body body = new Body(); body.setType("span"); body.setSize(24); if(rcode == 201) { body.setValue("您今天稍早已經簽到了。"); body.setColor("#FFAB00"); body.setBgcolor("#E6E6FA"); } else { body.setValue("簽到成功。"); body.setColor("#00D647"); body.setBgcolor("#E6E6FA"); } apiOut.setRcode("200"); apiOut.setRdesc("ok"); apiOut.setPagename("checkin"); apiOut.setReturnpage("home"); apiOut.setBody(Arrays.asList(body)); return apiOut; } private ApiOut checkoutHandler(ApiIn apiIn, ApiOut apiOut) { String userid = apiIn.getUserid(); // query crm raw data RestTemplate restTemplate = new RestTemplate(); HttpHeaders headers = new HttpHeaders(); headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED); MultiValueMap<String, String> map = new LinkedMultiValueMap<>(); map.add("userid", userid); HttpEntity<MultiValueMap<String, String>> request = new HttpEntity<>(map, headers); ResponseEntity<Integer> response= restTemplate.postForEntity(API_CHECKOUT, request, Integer.class); Integer rcode = response.getBody(); logger.debug("rcode = {}", rcode); Body body = new Body(); body.setType("span"); body.setSize(24); if(rcode == 201) { body.setValue("您今天已經簽退了。"); body.setColor("#FFAB00"); body.setBgcolor("#E6E6FA"); } else if(rcode == 203) { body.setValue("簽退失敗,您今天尚未簽到。"); body.setColor("#FFAB00"); body.setBgcolor("#E6E6FA"); } else { body.setValue("簽退成功。"); body.setColor("#00D647"); body.setBgcolor("#E6E6FA"); } apiOut.setRcode("200"); apiOut.setRdesc("ok"); apiOut.setPagename("checkout"); apiOut.setReturnpage("home"); apiOut.setBody(Arrays.asList(body)); return apiOut; } private ApiOut historyHandler(ApiIn apiIn, ApiOut apiOut) { String userid = apiIn.getUserid(); // query crm raw data RestTemplate restTemplate = new RestTemplate(); HttpHeaders headers = new HttpHeaders(); headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED); MultiValueMap<String, String> map = new LinkedMultiValueMap<>(); map.add("userid", userid); HttpEntity<MultiValueMap<String, String>> request = new HttpEntity<>(map, headers); ResponseEntity<Checkin[]> response= restTemplate.postForEntity(API_HISTORY, request, Checkin[].class); Checkin[] checkins = response.getBody(); logger.debug("checkins.length = {}", checkins.length); List<Checkin> listCheckin = Arrays.asList(checkins); List<Body> bodys = DataUtils.checkinsToBodys(listCheckin); apiOut.setRcode("200"); apiOut.setRdesc("ok"); apiOut.setPagename("history"); apiOut.setReturnpage("home"); apiOut.setBody(bodys); return apiOut; } }
28.923077
104
0.72234
17628fc11c2103877d614d7b0940de8bc7b5af70
1,408
package com.digero.common.util; import java.awt.Graphics; import java.awt.Point; import javax.swing.event.ChangeListener; import javax.swing.text.Caret; import javax.swing.text.JTextComponent; /** * A Caret implementation that does nothing. Useful for making a TextArea be readonly. */ public class NullCaret implements Caret { @Override public void setVisible(boolean v) { } @Override public void setSelectionVisible(boolean v) { } @Override public void setMagicCaretPosition(Point p) { } @Override public void setDot(int dot) { } @Override public void setBlinkRate(int rate) { } @Override public void paint(Graphics g) { } @Override public void moveDot(int dot) { } @Override public boolean isVisible() { return false; } @Override public boolean isSelectionVisible() { return false; } @Override public void install(JTextComponent c) { } @Override public int getMark() { return 0; } @Override public Point getMagicCaretPosition() { return new Point(0, 0); } @Override public int getDot() { return 0; } @Override public int getBlinkRate() { return 0; } @Override public void deinstall(JTextComponent c) { } @Override public void addChangeListener(ChangeListener l) { } @Override public void removeChangeListener(ChangeListener l) { } }
15.820225
87
0.673295
f7170dc244a9f8395f9f100fc275bc209616e1ec
2,526
package camaratransparente.error; import org.springframework.core.Ordered; import org.springframework.core.annotation.Order; import org.springframework.http.HttpHeaders; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.lang.Nullable; import org.springframework.web.bind.annotation.ControllerAdvice; import org.springframework.web.bind.annotation.ExceptionHandler; import org.springframework.web.context.request.WebRequest; import org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler; import camaratransparente.error.exception.EntidadeNaoEncontradaException; import camaratransparente.error.exception.QuantidadeRequisicoesEsgotadaException; import lombok.extern.log4j.Log4j2; @Log4j2 @Order(Ordered.HIGHEST_PRECEDENCE) @ControllerAdvice public class RestExceptionHandler extends ResponseEntityExceptionHandler { @ExceptionHandler(QuantidadeRequisicoesEsgotadaException.class) protected ResponseEntity<?> handleQuantidadeRequisicoesEsgotadaException(QuantidadeRequisicoesEsgotadaException ex) { HttpStatus status = HttpStatus.TOO_MANY_REQUESTS; HttpHeaders cabecalhos = new HttpHeaders(); cabecalhos.add("X-Rate-Limit-Retry-After-Seconds", String.valueOf(ex.getSegundosAteProximaTentativa())); DetalhesErro detalhesErro = criarDetalhesErro(status, ex); return criarResponseEntity(detalhesErro, cabecalhos, status); } @ExceptionHandler(EntidadeNaoEncontradaException.class) protected ResponseEntity<?> handleEntidadeNaoEncontradaException(EntidadeNaoEncontradaException ex) { HttpStatus status = HttpStatus.NOT_FOUND; DetalhesErro detalhesErro = criarDetalhesErro(status, ex); return criarResponseEntity(detalhesErro, null, status); } @Override protected ResponseEntity<Object> handleExceptionInternal(Exception ex, @Nullable Object body, HttpHeaders headers, HttpStatus status, WebRequest request) { log.error("Erro interno.", ex); DetalhesErro detalhesErro = criarDetalhesErro(status, ex); return criarResponseEntity(detalhesErro, headers, status); } private DetalhesErro criarDetalhesErro(HttpStatus status, Exception ex) { return new DetalhesErro(status.value(), status.getReasonPhrase(), ex.getMessage()); } private ResponseEntity<Object> criarResponseEntity(DetalhesErro detalhesErro, HttpHeaders headers, HttpStatus status) { return new ResponseEntity<>(detalhesErro, headers, status); } }
41.409836
121
0.810768
4ca2144ee84cd798f1f159e8a844ac2c88a01fdf
12,382
package tilda.generation.helpers; import java.util.ArrayDeque; import java.util.ArrayList; import java.util.Deque; import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Set; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import tilda.enums.FrameworkSourcedType; import tilda.parsing.parts.Column; import tilda.parsing.parts.ForeignKey; import tilda.parsing.parts.Object; import tilda.parsing.parts.View; import tilda.parsing.parts.ViewColumn; import tilda.utils.TextUtil; public class TableRankTracker { protected static final Logger LOG = LogManager.getLogger(TableRankTracker.class.getName()); public TableRankTracker(Object O, int V, String As) { _O = O; _N = O.getShortName(); _V = V; _As = As; } public final Object _O; public final String _N; public final int _V; public final String _As; public String getFullName() { return TextUtil.isNullOrEmpty(_As)==false ? (_N.replace(".", "_")+_As) : _V == 1 ? _N : _N.replace(".", "_") + "_" + _V; } public static TableRankTracker getElementFromLast(Deque<TableRankTracker> TRTD, Object O, String As) { Set<String> TableNames = new HashSet<String>(); return getElementFromLast(TRTD, O, TableNames, 0, As); } public static TableRankTracker getElementFromLast(Deque<TableRankTracker> TRTD, Object O, Set<String> TableNames, int Level, String As) { Iterator<TableRankTracker> I = TRTD.descendingIterator(); while (I.hasNext() == true) { TableRankTracker TI = I.next(); if (TI._O.getFullName().equals(O.getFullName()) == true && (TextUtil.isNullOrEmpty(As) == true || As.equals(TI._As) == true)) return TI; if (TI._O._FST == FrameworkSourcedType.VIEW) { View SubV = TI._O._ParentSchema.getSourceView(TI._O); if (SubV._PK != null && SubV._PK._ColumnObjs.get(0)._ParentObject.getFullName().equals(O.getFullName()) == true && (TextUtil.isNullOrEmpty(As) == true || As.equals(TI._As) == true) ) return TI; /* Deque<TableRankTracker> SubTRTD = new ArrayDeque<TableRankTracker>(); for (ViewColumn VC : SubV._ViewColumns) { if (TableNames.add(VC._SameAsObj._ParentObject.getFullName()) == true) SubTRTD.add(new TableRankTracker(VC._SameAsObj._ParentObject, 1)); } if (getElementFromLast(SubTRTD, O, TableNames, Level + 1) != null) return TI; */ } } return null; } public static String PrintTableNames(Deque<TableRankTracker> TRTD) { StringBuilder Str = new StringBuilder(); Iterator<TableRankTracker> I = TRTD.descendingIterator(); while (I.hasNext() == true) { TableRankTracker TI = I.next(); if (Str.length() > 0) Str.append(", "); Str.append(TI.getFullName()); } return Str.toString(); } public static int findFKDeep(Deque<TableRankTracker> TRTD, Object O, List<Column> FKSourceCols, View V, int columnCount) throws Exception { Set<String> TableNames = new HashSet<String>(); return findFKDeep(TRTD, O, FKSourceCols, V, columnCount, TableNames, 0); } public static int findFKDeep(Deque<TableRankTracker> TRTD, Object O, List<Column> FKSourceCols, View V, int columnCount, Set<String> TableNames, int Level) throws Exception { Iterator<TableRankTracker> I = TRTD.descendingIterator(); int i = TRTD.size(); while (I.hasNext() == true) { TableRankTracker TI = I.next(); --i; if (TI._O._FST == FrameworkSourcedType.VIEW) // go down the rabbit hole { View SubV = TI._O._ParentSchema.getSourceView(TI._O); Deque<TableRankTracker> SubTRTD = new ArrayDeque<TableRankTracker>(); for (ViewColumn VC : SubV._ViewColumns) { if (TableNames.add(VC._SameAsObj._ParentObject.getFullName()) == true) SubTRTD.add(new TableRankTracker(VC._SameAsObj._ParentObject, 1, VC._As)); } if (SubTRTD.isEmpty() == false) { // LOG.debug(PaddingUtil.getPad(Level * 3) + "Checking referenced view " + TI._O.getShortName()); if (findFKDeep(SubTRTD, O, FKSourceCols, V, columnCount, TableNames, Level + 1) != -1) { // LOG.debug(PaddingUtil.getPad(Level * 3) + "Got it from a sub-table!"); return i; } } } else { // LOG.debug(PaddingUtil.getPad(Level * 3) + "Checking referenced table " + TI._O.getShortName()); if (TI._O.getFullName().equals(O.getFullName()) == true) { // LOG.debug(PaddingUtil.getPad(Level * 3) + "Got it! Now searching for nearest column from table " + O.getShortName() + "."); if (Level == 0) { while (columnCount >= 0) { ViewColumn VC = V._ViewColumns.get(columnCount); if (VC._SameAsObj._ParentObject.getFullName().equals(O.getFullName()) == true) return columnCount; --columnCount; } } else if (recurseStuff(V, O, columnCount, FKSourceCols) != -1) return columnCount; } } } return -1; } private static int recurseStuff(View V, Object O, int columnStart, List<Column> FKSourceCols) { while (columnStart >= 0) { ViewColumn VC = V._ViewColumns.get(columnStart); // LOG.debug(" Checking view column " + VC.getShortName() + " (" + columnStart + ") from sameAs " + VC._SameAsObj.getShortName()); if (VC._SameAsObj._ParentObject._FST == FrameworkSourcedType.VIEW) { View SubV = V._ParentSchema.getSourceView(VC._SameAsObj._ParentObject); if (recurseStuff(SubV, O, SubV._ViewColumns.size() - 1, FKSourceCols) != -1) return columnStart; } else if (CheckColIn(VC._SameAsObj, FKSourceCols) == true && VC._SameAsObj._ParentObject.getFullName().equals(O.getFullName()) == true) return columnStart; --columnStart; } return -1; } private static boolean CheckColIn(Column Col, List<Column> Columns) { for (Column C : Columns) if (C.getFullName().equals(Col.getFullName()) == true) return true; return false; } public static ForeignKey getClosestFKTable(Deque<TableRankTracker> TRTD, Object O, View V, int columnCount) throws Exception { List<ForeignKey> FKs = new ArrayList<ForeignKey>(); // LOG.debug("\nChecking FK to/from " + O.getShortName() + " based on view column " + V._ViewColumns.get(columnCount).getShortName() + " mapped to " + V._ViewColumns.get(columnCount)._SameAsObj.getShortName()); Iterator<TableRankTracker> I = TRTD.descendingIterator(); while (I.hasNext() == true) { TableRankTracker TI = I.next(); if (TI._O.getFullName().equals(O.getFullName()) == true) continue; TableRankTracker.getAllForeignMatchingKeys(O, FKs, TI); } // LOG.debug("Found " + FKs.size() + " FK(s)"); ForeignKey MostRecentFK = null; int MostRecentFKPos = -1; // LOG.debug("Searching for FK to/from " + O.getShortName()); for (ForeignKey FK : FKs) { Object FKObj = O.getFullName().equals(FK._ParentObject.getFullName()) == true || O._FST == FrameworkSourcedType.VIEW ? FK._DestObjectObj : O.getFullName().equals(FK._ParentObject.getFullName()) == true ? FK._ParentObject : O; List<Column> FKColumns = FKObj.getFullName().equals(FK._ParentObject.getFullName()) == true ? FK._SrcColumnObjs : FK._DestObjectObj._PrimaryKey._ColumnObjs; // LOG.debug("Examining FK " + FK._Name + ": " + FK._ParentObject.getShortName() + " -> " + FK._DestObjectObj.getShortName()); // LOG.debug(" Picked Obj: " + FKObj.getShortName()); // LOG.debug(" Picked FK columns: " + Column.PrintColumnList(FKColumns)); int pos = TableRankTracker.findFKDeep(TRTD, FKObj, FKColumns, V, columnCount); // LOG.debug(" Most recent reference to " + FKObj.getShortName() + " as pos :" + pos + "."); if (pos == -1 && MostRecentFKPos == -1) throw new Exception("The view " + V.getShortName() + " uses columns from table " + FK._DestObjectObj.getShortName() + " and no foreign key can be found to/from " + O.getShortName() + "."); // LOG.debug(" --> Found FK " + FK._Name + ": " + Column.PrintColumnList(FK._SrcColumnObjs)); if (pos > MostRecentFKPos) { MostRecentFKPos = pos; MostRecentFK = FK; // LOG.debug(" This is now the new most-recent FK."); } } if (MostRecentFK != null) { // LOG.debug(" --> PICKED FK " + MostRecentFK._Name + ": " + Column.PrintColumnList(MostRecentFK._SrcColumnObjs)); } return MostRecentFK; } private static void getAllForeignMatchingKeys(Object O, List<ForeignKey> FKs, TableRankTracker TI) { Set<String> TableNames = new HashSet<String>(); getAllForeignMatchingKeys(O, FKs, TI, TableNames, 0); } private static void getAllForeignMatchingKeys(Object O, List<ForeignKey> FKs, TableRankTracker TI, Set<String> TableNames, int Level) { if (TI._O._FST == FrameworkSourcedType.VIEW || O._FST == FrameworkSourcedType.VIEW) { boolean TI_View = TI._O._FST == FrameworkSourcedType.VIEW; // LOG.debug(PaddingUtil.getPad(Level * 3) + "Checking referenced view (" + (TI_View ? "TI" : "O") + ") " + (TI_View ? TI._O : O).getShortName()); View SubV = TI_View ? TI._O._ParentSchema.getSourceView(TI._O) : O._ParentSchema.getSourceView(O); for (ViewColumn VC : SubV._ViewColumns) { if (TableNames.add(VC._SameAsObj._ParentObject.getFullName()) == true) getAllForeignMatchingKeys(TI_View ? O : TI._O, FKs, new TableRankTracker(VC._SameAsObj._ParentObject, 1, VC._As), TableNames, Level + 1); } } else { // LOG.debug(PaddingUtil.getPad(Level * 3) + "Checking to " + TI._O.getShortName()); for (ForeignKey FK : O._ForeignKeys) if (FK._DestObjectObj.getFullName().equals(TI._O.getFullName()) == true) { // LOG.debug(PaddingUtil.getPad(Level * 3) + " --> Found FK to " + TI._O.getShortName() + " from " + O.getShortName()); FKs.add(FK); } // LOG.debug(PaddingUtil.getPad(Level * 3) + "Checking from " + TI._O.getShortName()); for (ForeignKey FK : TI._O._ForeignKeys) if (FK._DestObjectObj.getFullName().equals(O.getFullName()) == true) { // LOG.debug(PaddingUtil.getPad(Level * 3) + " --> Found FK " + FK._Name + " from " + TI._O.getShortName() + " to " + O.getShortName()); FKs.add(FK); } } } }
45.355311
218
0.547004
1e052b4bc4f2025031898315878542c4155e9d5b
2,299
package demo; import static org.junit.Assert.*; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.*; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.ActiveProfiles; import org.springframework.test.context.junit4.SpringRunner; import org.springframework.test.context.web.WebAppConfiguration; import org.springframework.test.web.servlet.MockMvc; import org.springframework.test.web.servlet.MvcResult; import org.springframework.test.web.servlet.setup.MockMvcBuilders; import org.springframework.web.context.WebApplicationContext; /** * Out-of-container test for the config server. * Verifies that the server serves up configuration when asked. * Uses "native" profile to obtain properties from local file system rather than GitHub. * * @author ken krueger */ @RunWith(SpringRunner.class) @SpringBootTest(classes = Application.class) @WebAppConfiguration @ActiveProfiles("native") // "native" means use local classpath location rather than GitHub. public class OutOfContainerTest { @Autowired WebApplicationContext spring; MockMvc mockMvc; @Before public void setup() { mockMvc = MockMvcBuilders.webAppContextSetup(spring).build(); } @Test public void propertyLoadTest() throws Exception { // To test if this config server is working, we will simulate a "testConfig" client // calling to get properties for its default profile. These configuration files // (application.yml and testConfig.yml) are on the classpath as the server is // running the 'native' profile: MvcResult result = mockMvc.perform(get("/testConfig-default.properties")) .andExpect(status().isOk()) .andReturn() ; String returned = result.getResponse().getContentAsString(); // Check that the test values from the yml are present in the properties: assertTrue(returned.contains("fromApplication:")); assertTrue(returned.contains("applicationValue")); assertTrue(returned.contains("fromTestConfig:")); assertTrue(returned.contains("testConfigValue")); } }
37.080645
92
0.786429
da8aea076a8f076cb05b3f6c60b19be3aea02a74
222
package com.github.dantebarba.aportestruchos.support; public class Utils { public static String normalizar(String data) { if (data == null) return ""; return data.trim().replace(".", "").replace("-", ""); } }
17.076923
55
0.653153
d865a937066da74fd5e5b2d09dd53d952c4fdb32
1,252
package brainwine.gameserver.msgpack.models; import brainwine.gameserver.server.requests.DialogRequest; /** * For {@link DialogRequest} * TODO Figure out more about all this. */ public class DialogInputData { private String dialogName; private int dialogId; private String[] inputData; private String action; public DialogInputData(String dialogName) { this.dialogName = dialogName; } public DialogInputData(int dialogId, String[] inputData) { this.dialogId = dialogId; this.inputData = inputData; } public DialogInputData(int dialogId, String action) { this.dialogId = dialogId; this.action = action; } public boolean isType1() { return dialogName != null; } public boolean isType2() { return dialogId != 0 && inputData != null; } public boolean isType3() { return dialogId != 0 && action != null; } public String getDialogName() { return dialogName; } public int getDialogId() { return dialogId; } public String[] getInputData() { return inputData; } public String getAction() { return action; } }
21.586207
62
0.605431
7a4e3be708cd0ba6c687d6ab187a0c7fd761a488
1,446
package com.stardust.autojs; import android.webkit.MimeTypeMap; import com.stardust.pio.PFiles; import org.junit.Test; import java.io.File; import java.io.IOException; import okhttp3.MediaType; import okhttp3.MultipartBody; import okhttp3.OkHttpClient; import okhttp3.Request; import okhttp3.RequestBody; import okhttp3.Response; /** * Example local unit test, which will execute on the development machine (host). * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ public class ExampleUnitTest { @Test public void test() throws IOException { File file = new File("C:\\Users\\Stardust\\Desktop\\1.txt"); System.out.println(PFiles.read(file)); String url = "http://posttestserver.com/post.php?dir=example"; OkHttpClient client = new OkHttpClient(); RequestBody formBody = new MultipartBody.Builder() .setType(MultipartBody.FORM) .addFormDataPart("file", file.getName(), RequestBody.create(MediaType.parse("text/plain"), file)) .addFormDataPart("other_field", "other_field_value") .build(); Request request = new Request.Builder().url(url).post(formBody).build(); Response response = client.newCall(request).execute(); System.out.println(response.body().string()); } public boolean equals(int i, int j) { return i == j; } }
30.765957
81
0.663209
fc37d4a55af7e7481a91153d1057db9d72fd886a
2,347
/* * 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. */ package com.opensymphony.xwork2.spring.interceptor; import com.opensymphony.xwork2.*; import com.opensymphony.xwork2.interceptor.PreResultListener; import com.opensymphony.xwork2.util.ValueStack; import java.lang.reflect.Method; /** * @author Simon Stewart */ public class TestActionInvocation implements ActionInvocation { private Object action; private boolean executed; public TestActionInvocation(Object wrappedAction) { this.action = wrappedAction; } public Object getAction() { return action; } public boolean isExecuted() { return executed; } public ActionContext getInvocationContext() { return null; } public ActionProxy getProxy() { return null; } public Result getResult() throws Exception { return null; } public String getResultCode() { return null; } public void setResultCode(String resultCode) { } public ValueStack getStack() { return null; } public void addPreResultListener(PreResultListener listener) { } public String invoke() throws Exception { return invokeActionOnly(); } public String invokeActionOnly() throws Exception { executed = true; Method method = action.getClass().getMethod("execute", new Class[0]); return (String) method.invoke(action, new Object[0]); } public void setActionEventListener(ActionEventListener listener) { } public void init(ActionProxy proxy) { } }
26.077778
77
0.698338
343c39df86c0ec13caba74b3d0ba08c7e930c233
988
package io.delta.standalone.expressions; import io.delta.standalone.types.BooleanType; import io.delta.standalone.internal.exception.DeltaErrors; /** * Evaluates logical {@code expr1} AND {@code expr2} for {@code new And(expr1, expr2)}. * <p> * Requires both left and right input expressions evaluate to booleans. */ public final class And extends BinaryOperator implements Predicate { public And(Expression left, Expression right) { super(left, right, "&&"); if (!(left.dataType() instanceof BooleanType) || !(right.dataType() instanceof BooleanType)) { throw DeltaErrors.illegalExpressionValueType( "AND", "bool", left.dataType().getTypeName(), right.dataType().getTypeName()); } } @Override public Object nullSafeEval(Object leftResult, Object rightResult) { return (boolean) leftResult && (boolean) rightResult; } }
32.933333
87
0.633603
24fd84b26e7f8a95b136898ca7619c4d82e4806b
1,183
package filter; public class PT1 extends ClosedLoopBlock { /** * == CodeSys Code == * * IF bReset THEN * reset(); * END_IF * * IF (rT > 0.0) THEN * rY := rY + (-rY + rK*rX)/MAX(rT,0.001)*RET_COMMON.rDt; * ELSE * rY := rX; * END_IF * * == Variable/Function explanation == * * rY internal output variable = Y * rX internal input variable = U * rK = K * rT = T * MAX(x, y) = returns the bigger value of the given values * RET_COMMON.rDt = cycle time main task * reset() = sets rY = 0.0 * * * * */ /** * Internal amplification variable */ private double rK; /** * Internal delay variable */ private double rT; public PT1(double amplification, double delay){ rT = delay; rK = amplification; reset(); } @Override public void reset(){ rY = 0.0; } @Override public void updateOutput() { if(Double.compare(rT, 0.0) == 0){ rY = rX; return; } rY = rY + (-rY + rK*rX)/super.max(rT,0.001)*cycTime; } }
18.484375
63
0.481826
fb4d3c100b34ed396b568db9169275ded425e79d
1,150
package voogasalad_GucciGames.gameplayer.windows.mainwindow.components; import javafx.scene.Parent; import voogasalad_GucciGames.gameplayer.controller.GameControllerInterface; import voogasalad_GucciGames.gameplayer.scenes.GameScene; public abstract class WindowComponent { private GameScene myScene; private GameControllerInterface myController; private Parent myParent; public WindowComponent(GameScene scene, GameControllerInterface controller) { setScene(scene); setController(controller); } public Parent getParent() { return myParent; } public void setParent(Parent parent) { setParent(parent, true); } public void setParent(Parent parent, boolean applyCSS) { myParent = parent; if (applyCSS) { styleParent(); } } private void styleParent() { myParent.getStyleClass().add("gametext"); } public GameScene getGameScene() { return myScene; } public void setScene(GameScene myScene) { this.myScene = myScene; } public GameControllerInterface getController() { return myController; } public void setController(GameControllerInterface myController) { this.myController = myController; } }
21.296296
78
0.775652
17babc50ddaad773a83a3249aa68c275153c766c
3,203
import com.github.liao47.leetcode.P0160IntersectionOfTwoLinkedLists; import com.github.liao47.leetcode.P0160IntersectionOfTwoLinkedLists.ListNode; import com.github.liao47.leetcode.P0162FindPeakElement; import com.github.liao47.leetcode.P0165CompareVersionNumbers; import org.junit.Assert; import org.junit.Test; import java.util.Arrays; /** * @author liaoshiqing * @date 2021/7/21 17:28 */ public class LeetCode0160To0169Test { @Test public void test0160() { P0160IntersectionOfTwoLinkedLists solver = new P0160IntersectionOfTwoLinkedLists(); ListNode intersection = ListNode.of(8).next(4).next(5).head(); ListNode headA = ListNode.of(4).next(1).next(intersection).head(); ListNode headB = ListNode.of(5).next(0).next(1).next(intersection).head(); Assert.assertSame(intersection, solver.getIntersectionNode(headA, headB)); Assert.assertSame(intersection, solver.getIntersectionNode2(headA, headB)); System.out.println(intersection); System.out.println(headA); System.out.println(headB); intersection = ListNode.of(2).next(4).head(); headA = ListNode.of(0).next(9).next(1).next(intersection).head(); headB = ListNode.of(3).next(intersection).head(); Assert.assertSame(intersection, solver.getIntersectionNode(headA, headB)); Assert.assertSame(intersection, solver.getIntersectionNode2(headA, headB)); headA = ListNode.of(2).next(6).next(4).head(); headB = ListNode.of(1).next(5).head(); Assert.assertNull(solver.getIntersectionNode(headA, headB)); Assert.assertNull(solver.getIntersectionNode2(headA, headB)); } @Test public void test0162() { P0162FindPeakElement solver = new P0162FindPeakElement(); Assert.assertEquals(2, solver.findPeakElement(new int[]{1, 2, 3, 1})); Assert.assertTrue(Arrays.asList(1, 5).contains(solver.findPeakElement(new int[]{1, 2, 1, 3, 5, 6, 4}))); Assert.assertEquals(0, solver.findPeakElement(new int[]{3, 2, 1})); Assert.assertEquals(2, solver.findPeakElement(new int[]{1, 2, 3})); Assert.assertEquals(1, solver.findPeakElement(new int[]{1, 2, 1, 0, 1})); Assert.assertEquals(3, solver.findPeakElement(new int[]{1, 0, 1, 2, 1})); Assert.assertEquals(1, solver.findPeakElement(new int[]{1, 2})); Assert.assertEquals(0, solver.findPeakElement(new int[]{2, 1})); } @Test public void test0165() { P0165CompareVersionNumbers solver = new P0165CompareVersionNumbers(); Assert.assertEquals(0, solver.compareVersion("1.01", "1.001")); Assert.assertEquals(0, solver.compareVersion("1.0", "1.0.0")); Assert.assertEquals(-1, solver.compareVersion("0.1", "1.1")); Assert.assertEquals(1, solver.compareVersion("1.0.1", "1")); Assert.assertEquals(-1, solver.compareVersion("7.5.2.4", "7.5.3")); Assert.assertEquals(1, solver.compareVersion("1.1", "1.0.1")); Assert.assertEquals(0, solver.compareVersion("01", "1")); Assert.assertEquals(1, solver.compareVersion("1.05", "1.1")); Assert.assertEquals(-1, solver.compareVersion("1.2", "1.10")); } }
48.530303
112
0.676865
694720bbdac11c4a78720e6c102948b0c83ae689
3,388
package org.jboss.errai.ioc.client; import com.google.gwt.event.logical.shared.HasAttachHandlers; import com.google.gwt.event.shared.HasHandlers; import com.google.gwt.user.client.EventListener; import com.google.gwt.user.client.ui.AcceptsOneWidget; import com.google.gwt.user.client.ui.HasOneWidget; import com.google.gwt.user.client.ui.HasVisibility; import com.google.gwt.user.client.ui.HasWidgets; import com.google.gwt.user.client.ui.HasWidgets.ForIsWidget; import com.google.gwt.user.client.ui.IsWidget; import com.google.gwt.user.client.ui.Panel; import com.google.gwt.user.client.ui.SimplePanel; import com.google.gwt.user.client.ui.UIObject; import com.google.gwt.user.client.ui.Widget; import javax.enterprise.context.Dependent; import javax.inject.Provider; import org.jboss.errai.ioc.client.container.Context; import org.jboss.errai.ioc.client.container.ContextManager; import org.jboss.errai.ioc.client.container.Factory; import org.jboss.errai.ioc.client.container.FactoryHandle; import org.jboss.errai.ioc.client.container.FactoryHandleImpl; import org.jboss.errai.ioc.client.container.Proxy; import org.jboss.errai.ui.nav.client.local.NavigationPanel; public class Provider_factory__o_j_e_u_n_c_l_NavigationPanel__quals__j_e_i_Any_j_e_i_Default extends Factory<NavigationPanel> { private FactoryHandleImpl handle = new FactoryHandleImpl(NavigationPanel.class, "Provider_factory__o_j_e_u_n_c_l_NavigationPanel__quals__j_e_i_Any_j_e_i_Default", Dependent.class, false, null, true); public Provider_factory__o_j_e_u_n_c_l_NavigationPanel__quals__j_e_i_Any_j_e_i_Default() { handle.addAssignableType(NavigationPanel.class); handle.addAssignableType(SimplePanel.class); handle.addAssignableType(Panel.class); handle.addAssignableType(Widget.class); handle.addAssignableType(UIObject.class); handle.addAssignableType(Object.class); handle.addAssignableType(HasVisibility.class); handle.addAssignableType(EventListener.class); handle.addAssignableType(HasAttachHandlers.class); handle.addAssignableType(HasHandlers.class); handle.addAssignableType(IsWidget.class); handle.addAssignableType(ForIsWidget.class); handle.addAssignableType(HasWidgets.class); handle.addAssignableType(Iterable.class); handle.addAssignableType(HasOneWidget.class); handle.addAssignableType(AcceptsOneWidget.class); handle.addQualifier(QualifierUtil.ANY_ANNOTATION); handle.addQualifier(QualifierUtil.DEFAULT_ANNOTATION); } public void init(final Context context) { } public NavigationPanel createInstance(final ContextManager contextManager) { final Provider<NavigationPanel> provider = (Provider<NavigationPanel>) contextManager.getInstance("Type_factory__o_j_e_u_n_c_l_NavigationPanelProvider__quals__j_e_i_Any_j_e_i_Default"); final NavigationPanel instance = provider.get(); return instance; } public void generatedDestroyInstance(final Object instance, final ContextManager contextManager) { destroyInstanceHelper((NavigationPanel) instance, contextManager); } public void destroyInstanceHelper(final NavigationPanel instance, final ContextManager contextManager) { } public void invokePostConstructs(final NavigationPanel instance) { } public Proxy createProxy(final Context context) { return null; } public FactoryHandle getHandle() { return handle; } }
43.435897
201
0.817001
6e494e7f24a89d8bd45ed7bbb80db296c3cdfda4
1,664
package com.atlassian.jira.plugins.dvcs.spi.bitbucket.message.oldsync; import com.atlassian.jira.plugins.dvcs.service.message.AbstractMessagePayloadSerializer; import com.atlassian.jira.plugins.dvcs.service.message.MessagePayloadSerializer; import com.atlassian.jira.util.json.JSONObject; import org.springframework.stereotype.Component; import java.util.Date; /** * An implementation of {@link MessagePayloadSerializer} over {@link OldBitbucketSynchronizeCsetMsg}. * * @author Stanislav Dvorscak */ @Component public class OldBitbucketSynchronizeCsetMsgSerializer extends AbstractMessagePayloadSerializer<OldBitbucketSynchronizeCsetMsg> { @Override protected void serializeInternal(JSONObject json, OldBitbucketSynchronizeCsetMsg payload) throws Exception { json.put("branch", payload.getBranch()); json.put("node", payload.getNode()); json.put("refreshAfterSynchronizedAt", payload.getRefreshAfterSynchronizedAt().getTime()); } @Override protected OldBitbucketSynchronizeCsetMsg deserializeInternal(JSONObject json, final int version) throws Exception { String branch; String node; Date refreshAfterSynchronizedAt; branch = json.getString("branch"); node = json.getString("node"); refreshAfterSynchronizedAt = parseDate(json, "refreshAfterSynchronizedAt", version); return new OldBitbucketSynchronizeCsetMsg(null, branch, node, refreshAfterSynchronizedAt, null, false, 0, false); } @Override public Class<OldBitbucketSynchronizeCsetMsg> getPayloadType() { return OldBitbucketSynchronizeCsetMsg.class; } }
33.959184
121
0.756611
6227fdd13d28abf8c424bfe67b5b3d8e016f7c06
5,128
package cn.org.atool.fluent.form.meta; import cn.org.atool.fluent.common.kits.KeyMap; import cn.org.atool.fluent.common.kits.SegmentLocks; import cn.org.atool.fluent.form.annotation.MethodType; import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.Objects; /** * ArgNamesKit: 方法参数解析工具 * * @author wudarui */ public class ArgNamesKit { private static final KeyMap<MethodArgNames> cached = new KeyMap<>(); private static final SegmentLocks<String> lock = new SegmentLocks<>(32); /** * 从 method...() 方法中解析字段名称 * * @param method 方法名称 * @return 条件字段列表 */ public static MethodArgNames parseMethodStyle(String method) { lock.lockDoing(cached::containsKey, method, () -> cached.put(method, internalParse(method))); return cached.get(method); } private static MethodArgNames internalParse(String method) { int index = method.indexOf("By"); if (index <= 0) { return MethodArgNameNotFound; } String prefix = method.substring(0, index); if (MethodType.AUTO_PREFIX.contains(prefix)) { MethodArgNames names = parseArgNames(method, index + 2); if (Objects.equals("top", prefix)) { names.setTopN(1); } return names; } else if (prefix.matches("top\\d+")) { MethodArgNames names = parseArgNames(method, index + 2); names.setTopN(Integer.parseInt(prefix.substring(3))); return names; } else { return MethodArgNameNotFound; } } /* Collections.emptyList() 表示从方法名称中未解析到参数名 */ private static final MethodArgNames MethodArgNameNotFound = new MethodArgNames(true, Collections.emptyList()); private static MethodArgNames parseArgNames(String method, int offset) { List<String> names = new ArrayList<>(); StringBuilder name = new StringBuilder(); Boolean isAnd = null; int orderOffset = 0; for (int index = offset; index < method.length(); ) { char ch = method.charAt(index); if (matchWord(method, index, "And") && isCapital(method, index + 3)) { names.add(name.toString()); name = new StringBuilder(); index += 3; if (Objects.equals(isAnd, false)) { throw new IllegalStateException("The method name[" + method + "] cannot contain both and or logic."); } isAnd = true; } else if (matchWord(method, index, "Or") && isCapital(method, index + 2)) { names.add(name.toString()); name = new StringBuilder(); index += 2; if (Objects.equals(isAnd, true)) { throw new IllegalStateException("The method name[" + method + "] cannot contain both and or logic."); } isAnd = false; } else if (matchWord(method, index, "OrderBy") && isCapital(method, index + 7)) { orderOffset = index + 7; break; } else { name.append(ch); index += 1; } } if (!name.toString().isEmpty()) { names.add(name.toString()); } MethodArgNames methodArgNames = new MethodArgNames(isAnd == null || isAnd, names); if (orderOffset == 0) { return methodArgNames; } name = new StringBuilder(); for (int index = orderOffset; index < method.length(); ) { char ch = method.charAt(index); if (matchWord(method, index, "Asc") && isCapital(method, index + 3)) { methodArgNames.addOrderBy(name.toString(), true); name = new StringBuilder(); index += 3; } else if (matchWord(method, index, "Desc") && isCapital(method, index + 4)) { methodArgNames.addOrderBy(name.toString(), false); name = new StringBuilder(); index += 4; } else { name.append(ch); index += 1; } } if (!name.toString().isEmpty()) { methodArgNames.addOrderBy(name.toString(), true); } return methodArgNames; } static boolean isCapital(String text, int index) { if (text.length() <= index) { return true; } else { char ch = text.charAt(index); return ch >= 'A' && ch <= 'Z'; } } /** * text文本从start位置点开始是子字符word * * @param text 完整文本 * @param start 匹配偏移点 * @param word 要匹配的字符串 * @return true/false */ public static boolean matchWord(String text, int start, String word) { if (text.length() < start + word.length()) { return false; } for (int index = 0; index < word.length(); index++) { if (text.charAt(start + index) != word.charAt(index)) { return false; } } return true; } }
35.365517
121
0.543877
f7366e0861a70d95bb730fb6d6cd69e8722a7de9
9,569
/* * Copyright (c) 2019, FusionAuth, All Rights Reserved * * Licensed 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. */ package io.fusionauth.domain; import java.util.Objects; import com.inversoft.json.JacksonConstructor; import com.inversoft.json.ToString; /** * @author Daniel DeGroff */ public class ExternalIdentifierConfiguration implements Buildable<ExternalIdentifierConfiguration> { public int authorizationGrantIdTimeToLiveInSeconds = 30; public SecureGeneratorConfiguration changePasswordIdGenerator = new SecureGeneratorConfiguration(32, SecureGeneratorType.randomBytes); public int changePasswordIdTimeToLiveInSeconds = 600; public int deviceCodeTimeToLiveInSeconds = 300; public SecureGeneratorConfiguration deviceUserCodeIdGenerator = new SecureGeneratorConfiguration(6, SecureGeneratorType.randomAlphaNumeric); public SecureGeneratorConfiguration emailVerificationIdGenerator = new SecureGeneratorConfiguration(32, SecureGeneratorType.randomBytes); public int emailVerificationIdTimeToLiveInSeconds = 86400; public SecureGeneratorConfiguration emailVerificationOneTimeCodeGenerator = new SecureGeneratorConfiguration(6, SecureGeneratorType.randomAlphaNumeric); public int externalAuthenticationIdTimeToLiveInSeconds = 300; public int oneTimePasswordTimeToLiveInSeconds = 60; public SecureGeneratorConfiguration passwordlessLoginGenerator = new SecureGeneratorConfiguration(32, SecureGeneratorType.randomBytes); public int passwordlessLoginTimeToLiveInSeconds = 180; public int pendingAccountLinkTimeToLiveInSeconds = 60 * 60; public SecureGeneratorConfiguration registrationVerificationIdGenerator = new SecureGeneratorConfiguration(32, SecureGeneratorType.randomBytes); public int registrationVerificationIdTimeToLiveInSeconds = 86400; public SecureGeneratorConfiguration registrationVerificationOneTimeCodeGenerator = new SecureGeneratorConfiguration(6, SecureGeneratorType.randomAlphaNumeric); public int samlv2AuthNRequestIdTimeToLiveInSeconds = 300; public SecureGeneratorConfiguration setupPasswordIdGenerator = new SecureGeneratorConfiguration(32, SecureGeneratorType.randomBytes); public int setupPasswordIdTimeToLiveInSeconds = 86400; public int twoFactorIdTimeToLiveInSeconds = 300; public SecureGeneratorConfiguration twoFactorOneTimeCodeIdGenerator = new SecureGeneratorConfiguration(6, SecureGeneratorType.randomDigits); public int twoFactorOneTimeCodeIdTimeToLiveInSeconds = 60; public int twoFactorTrustIdTimeToLiveInSeconds = 2592000; @JacksonConstructor public ExternalIdentifierConfiguration() { } public ExternalIdentifierConfiguration(ExternalIdentifierConfiguration other) { this.authorizationGrantIdTimeToLiveInSeconds = other.authorizationGrantIdTimeToLiveInSeconds; this.changePasswordIdGenerator = new SecureGeneratorConfiguration(other.changePasswordIdGenerator); this.changePasswordIdTimeToLiveInSeconds = other.changePasswordIdTimeToLiveInSeconds; this.deviceCodeTimeToLiveInSeconds = other.deviceCodeTimeToLiveInSeconds; this.deviceUserCodeIdGenerator = new SecureGeneratorConfiguration(other.deviceUserCodeIdGenerator); this.emailVerificationIdGenerator = new SecureGeneratorConfiguration(other.emailVerificationIdGenerator); this.emailVerificationIdTimeToLiveInSeconds = other.emailVerificationIdTimeToLiveInSeconds; this.emailVerificationOneTimeCodeGenerator = new SecureGeneratorConfiguration(other.emailVerificationOneTimeCodeGenerator); this.externalAuthenticationIdTimeToLiveInSeconds = other.externalAuthenticationIdTimeToLiveInSeconds; this.oneTimePasswordTimeToLiveInSeconds = other.oneTimePasswordTimeToLiveInSeconds; this.passwordlessLoginTimeToLiveInSeconds = other.passwordlessLoginTimeToLiveInSeconds; this.passwordlessLoginGenerator = new SecureGeneratorConfiguration(other.passwordlessLoginGenerator); this.pendingAccountLinkTimeToLiveInSeconds = other.pendingAccountLinkTimeToLiveInSeconds; this.registrationVerificationIdGenerator = new SecureGeneratorConfiguration(other.registrationVerificationIdGenerator); this.registrationVerificationIdTimeToLiveInSeconds = other.registrationVerificationIdTimeToLiveInSeconds; this.registrationVerificationOneTimeCodeGenerator = new SecureGeneratorConfiguration(other.registrationVerificationOneTimeCodeGenerator); this.samlv2AuthNRequestIdTimeToLiveInSeconds = other.samlv2AuthNRequestIdTimeToLiveInSeconds; this.setupPasswordIdGenerator = new SecureGeneratorConfiguration(other.setupPasswordIdGenerator); this.setupPasswordIdTimeToLiveInSeconds = other.setupPasswordIdTimeToLiveInSeconds; this.twoFactorIdTimeToLiveInSeconds = other.twoFactorIdTimeToLiveInSeconds; this.twoFactorOneTimeCodeIdGenerator = new SecureGeneratorConfiguration(other.twoFactorOneTimeCodeIdGenerator); this.twoFactorOneTimeCodeIdTimeToLiveInSeconds = other.twoFactorOneTimeCodeIdTimeToLiveInSeconds; this.twoFactorTrustIdTimeToLiveInSeconds = other.twoFactorTrustIdTimeToLiveInSeconds; } @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } ExternalIdentifierConfiguration that = (ExternalIdentifierConfiguration) o; return authorizationGrantIdTimeToLiveInSeconds == that.authorizationGrantIdTimeToLiveInSeconds && changePasswordIdTimeToLiveInSeconds == that.changePasswordIdTimeToLiveInSeconds && deviceCodeTimeToLiveInSeconds == that.deviceCodeTimeToLiveInSeconds && emailVerificationIdTimeToLiveInSeconds == that.emailVerificationIdTimeToLiveInSeconds && externalAuthenticationIdTimeToLiveInSeconds == that.externalAuthenticationIdTimeToLiveInSeconds && oneTimePasswordTimeToLiveInSeconds == that.oneTimePasswordTimeToLiveInSeconds && passwordlessLoginTimeToLiveInSeconds == that.passwordlessLoginTimeToLiveInSeconds && pendingAccountLinkTimeToLiveInSeconds == that.pendingAccountLinkTimeToLiveInSeconds && registrationVerificationIdTimeToLiveInSeconds == that.registrationVerificationIdTimeToLiveInSeconds && samlv2AuthNRequestIdTimeToLiveInSeconds == that.samlv2AuthNRequestIdTimeToLiveInSeconds && setupPasswordIdTimeToLiveInSeconds == that.setupPasswordIdTimeToLiveInSeconds && twoFactorIdTimeToLiveInSeconds == that.twoFactorIdTimeToLiveInSeconds && twoFactorOneTimeCodeIdTimeToLiveInSeconds == that.twoFactorOneTimeCodeIdTimeToLiveInSeconds && twoFactorTrustIdTimeToLiveInSeconds == that.twoFactorTrustIdTimeToLiveInSeconds && Objects.equals(changePasswordIdGenerator, that.changePasswordIdGenerator) && Objects.equals(deviceUserCodeIdGenerator, that.deviceUserCodeIdGenerator) && Objects.equals(emailVerificationIdGenerator, that.emailVerificationIdGenerator) && Objects.equals(emailVerificationOneTimeCodeGenerator, that.emailVerificationOneTimeCodeGenerator) && Objects.equals(passwordlessLoginGenerator, that.passwordlessLoginGenerator) && Objects.equals(registrationVerificationIdGenerator, that.registrationVerificationIdGenerator) && Objects.equals(registrationVerificationOneTimeCodeGenerator, that.registrationVerificationOneTimeCodeGenerator) && Objects.equals(setupPasswordIdGenerator, that.setupPasswordIdGenerator) && Objects.equals(twoFactorOneTimeCodeIdGenerator, that.twoFactorOneTimeCodeIdGenerator); } @Override public int hashCode() { return Objects.hash(authorizationGrantIdTimeToLiveInSeconds, changePasswordIdGenerator, changePasswordIdTimeToLiveInSeconds, deviceCodeTimeToLiveInSeconds, deviceUserCodeIdGenerator, emailVerificationIdGenerator, emailVerificationIdTimeToLiveInSeconds, emailVerificationOneTimeCodeGenerator, externalAuthenticationIdTimeToLiveInSeconds, oneTimePasswordTimeToLiveInSeconds, passwordlessLoginGenerator, passwordlessLoginTimeToLiveInSeconds, pendingAccountLinkTimeToLiveInSeconds, registrationVerificationIdGenerator, registrationVerificationIdTimeToLiveInSeconds, registrationVerificationOneTimeCodeGenerator, samlv2AuthNRequestIdTimeToLiveInSeconds, setupPasswordIdGenerator, setupPasswordIdTimeToLiveInSeconds, twoFactorIdTimeToLiveInSeconds, twoFactorOneTimeCodeIdGenerator, twoFactorOneTimeCodeIdTimeToLiveInSeconds, twoFactorTrustIdTimeToLiveInSeconds); } @Override public String toString() { return ToString.toString(this); } }
56.958333
161
0.790992
61c092390e4964d598b2d3a41291dc195ec10eb9
66,935
/* * Copyright (c) 2010-2015 Pivotal Software, Inc. All rights reserved. * * Licensed 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. See accompanying * LICENSE file. */ package diskRecovery; import hydra.BridgeHelper; import hydra.BridgePrms; import hydra.CacheHelper; import hydra.ClientVmInfo; import hydra.ClientVmMgr; import hydra.DistributedSystemHelper; import hydra.GatewayHubHelper; import hydra.GsRandom; import hydra.HydraSubthread; import hydra.HydraThreadGroup; import hydra.HydraThreadLocal; import hydra.Log; import hydra.MasterController; import hydra.PartitionDescription; import hydra.RegionDescription; import hydra.RegionHelper; import hydra.RemoteTestModule; import hydra.StopSchedulingTaskOnClientOrder; import hydra.TestConfig; import hydra.blackboard.SharedCounters; import java.io.BufferedReader; import java.io.File; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.FileReader; import java.io.FileWriter; import java.io.IOException; import java.io.PrintWriter; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; import com.newedge.account.domain.BackOfficeAccount; import com.newedge.account.domain.BackOfficeAccountCollection; import com.newedge.staticdata.domain.Product; import parReg.ParRegUtil; import util.AdminHelper; import util.BaseValueHolder; import util.NameFactory; import util.RandomValues; import util.SilenceListener; import util.StopStartVMs; import util.SummaryLogListener; import util.TestException; import util.TestHelper; import util.ValueHolder; import wan.query.WANQueryPrms; import com.gemstone.gemfire.admin.AdminDistributedSystem; import com.gemstone.gemfire.admin.AdminException; import com.gemstone.gemfire.cache.AttributesFactory; import com.gemstone.gemfire.cache.Cache; import com.gemstone.gemfire.cache.CacheClosedException; import com.gemstone.gemfire.cache.InterestResultPolicy; import com.gemstone.gemfire.cache.PartitionAttributes; import com.gemstone.gemfire.cache.PartitionAttributesFactory; import com.gemstone.gemfire.cache.PartitionedRegionStorageException; import com.gemstone.gemfire.cache.Region; import com.gemstone.gemfire.cache.RegionDestroyedException; import com.gemstone.gemfire.cache.persistence.PersistentReplicatesOfflineException; import com.gemstone.gemfire.cache.query.FunctionDomainException; import com.gemstone.gemfire.cache.query.NameResolutionException; import com.gemstone.gemfire.cache.query.Query; import com.gemstone.gemfire.cache.query.QueryInvocationTargetException; import com.gemstone.gemfire.cache.query.QueryService; import com.gemstone.gemfire.cache.query.SelectResults; import com.gemstone.gemfire.cache.query.TypeMismatchException; import com.gemstone.gemfire.distributed.DistributedMember; import com.gemstone.gemfire.distributed.DistributedSystemDisconnectedException; import com.gemstone.gemfire.distributed.GatewayCancelledException; import com.gemstone.gemfire.internal.cache.PartitionedRegionException; import com.gemstone.gemfire.internal.cache.xmlcache.CacheXmlGenerator; /** Tests to exercise startup with disk recovery and shutDownAll * * @author lynn * */ public class StartupShutdownTest { public static StartupShutdownTest testInstance = null; // instance fields to hold information about this test run private boolean isBridgeConfiguration; private boolean isBridgeClient; static int maxPRs = -1; static int maxReplicates = -1; static private HydraThreadLocal currentNumKeys = new HydraThreadLocal(); // used for batched loading private static final String allRegionsSnapshotKey = "allRegions"; /** Creates and initializes an edge client. */ public synchronized static void HydraTask_initializeClient() { if (testInstance == null) { testInstance = new StartupShutdownTest(); testInstance.initializeInstance(); CacheHelper.createCache("cache1"); createRegions("clientRegion", "clientRegion", false); if (testInstance.isBridgeConfiguration) { testInstance.isBridgeClient = true; boolean registerInterest = RecoveryPrms.getRegisterInterest(); if (registerInterest) { registerInterest(); } } } currentNumKeys.set(new Integer(0)); Log.getLogWriter().info("currentNumKeys is " + currentNumKeys); } /** Create the regions for this test. * * @param PRconfigName The hydra config name for PR regions. * @param replicateConfigName The hydra config name for replicate regions. * @param colocated If true, colocate some of the PR regions, if false then no PRs are colocated */ private static void createRegions(String PRconfigName, String replicateConfigName, boolean colocated) { for (int i = 1; i <= maxPRs; i++) { if (colocated) { // colocate all odd numbered regions with PR_1 if ((i != 1) && ((i % 2) == 1)) { // colocate all odd numbered PRs with PR_1 AttributesFactory aFactory = RegionHelper.getAttributesFactory(PRconfigName); RegionDescription rd = RegionHelper.getRegionDescription(PRconfigName); PartitionDescription pd = rd.getPartitionDescription(); PartitionAttributesFactory prFactory = pd.getPartitionAttributesFactory(); prFactory.setColocatedWith("PR_1"); PartitionAttributes prAttrs = prFactory.create(); aFactory.setPartitionAttributes(prAttrs); RegionHelper.createRegion("PR_" + i, aFactory); } else { RegionHelper.createRegion("PR_" + i, PRconfigName); } } else { RegionHelper.createRegion("PR_" + i, PRconfigName); } } for (int i = 1; i <= maxReplicates; i++) { RegionHelper.createRegion("replicate_" + i, replicateConfigName); } Log.getLogWriter().info("After creating regions, root regions is " + CacheHelper.getCache().rootRegions()); //@todo lynn generateCacheXmlFile("vm_" + RemoteTestModule.getMyVmid() + ".xml"); } /** Creates and initializes a server or peer. */ public synchronized static void HydraTask_initialize() { if (testInstance == null) { testInstance = new StartupShutdownTest(); testInstance.initializeInstance(); CacheHelper.createCache("cache1"); createRegions("persistPR", "persistReplicate", RecoveryPrms.getUseColocatedPRs()); int myVmId = RemoteTestModule.getMyVmid(); RecoveryBB.getBB().getSharedMap().put("dataStoreJvm_" + myVmId, new ClientVmInfo(myVmId)); if (testInstance.isBridgeConfiguration) { testInstance.isBridgeClient = false; BridgeHelper.startBridgeServer("bridge"); } } currentNumKeys.set(new Integer(0)); Log.getLogWriter().info("currentNumKeys is " + currentNumKeys); } /** Creates and initializes a server or peer with colocated PRs allowing exceptions * due to shutDownAll being called. */ public synchronized static void HydraTask_initializeDuringShutDownAll() { try { HydraTask_initialize(); } catch (CacheClosedException e) { Log.getLogWriter().info("Caught " + e); } catch (IllegalStateException e) { String errStr = e.toString(); if (errStr.indexOf("Region specified in 'colocated-with' is not present. It should be " + "created before setting 'colocated-with' to this region.") >= 0) { // OK, this is accepted during a shutDownAll Log.getLogWriter().info("Caught " + e); } else { throw e; } } catch (NullPointerException e) { // only allow this if hydra is the first thing in the call stack // hydra gets the cache, which is null if (e.getCause() != null) { throw e; } String errStr = TestHelper.getStackTrace(e); int index1 = errStr.lastIndexOf(NullPointerException.class.getName()); // next line is first line of call stack if (index1 < 0) { throw e; } int index2 = errStr.indexOf("\n", index1); // end of NPE line, next line is first line of call stack if (index2 < 0) { throw e; } int index3 = errStr.indexOf("\n", index2+1); if (index3 < 0) { throw e; } String firstLine = errStr.substring(index2, index3); if ((firstLine.indexOf("hydra.DiskStoreHelper.createDiskStore") >= 0) || (firstLine.indexOf("hydra.DiskStoreHelper.getDiskStoreFactory") >= 0)) { Log.getLogWriter().info("Caught " + errStr + " while initializing during shutDownAll"); } else { throw e; } } catch (DistributedSystemDisconnectedException e) { Log.getLogWriter().info("Caught " + e); } } /** Create gateway hub * */ public static void HydraTask_createGatewayHub() { String hubConfigName = "gatewayHub"; Log.getLogWriter().info("Creating gateway hub with hub config: " + hubConfigName); GatewayHubHelper.createGatewayHub(hubConfigName); } /** Create gateway hub * */ public static void HydraTask_addGatewayHub() { String gatewayConfigName = "gateway"; Log.getLogWriter().info("Adding gateway with gateway config: " + gatewayConfigName); GatewayHubHelper.addGateways(gatewayConfigName); } /** Start gateway hub * */ public static void HydraTask_startGatewayHub() { Log.getLogWriter().info("Starting gateway hub"); GatewayHubHelper.startGatewayHub(); } public static void HydraTask_serversAreBack() { long counter = RecoveryBB.getBB().getSharedCounters().incrementAndRead(RecoveryBB.serversAreBack); Log.getLogWriter().info("serversAreBack counter is " + counter); } /** Creates and initializes a server or peer with all empty or accessor regions. */ public synchronized static void HydraTask_initializeProxy() { if (testInstance == null) { testInstance = new StartupShutdownTest(); testInstance.initializeInstance(); CacheHelper.createCache("cache1"); createRegions("proxyPR", "proxyReplicate", RecoveryPrms.getUseColocatedPRs()); int myVmId = RemoteTestModule.getMyVmid(); RecoveryBB.getBB().getSharedMap().put("proxyJvm_" + myVmId, new ClientVmInfo(myVmId)); if (testInstance.isBridgeConfiguration) { testInstance.isBridgeClient = false; BridgeHelper.startBridgeServer("bridge"); } } currentNumKeys.set(new Integer(0)); Log.getLogWriter().info("currentNumKeys is " + currentNumKeys); } public static void HydraTask_verifyFromLeaderSnapshot() { TestHelper.waitForCounter(RecoveryBB.getBB(), "snapshotWritten", RecoveryBB.snapshotWritten , 1, true, -1, 3000); testInstance.verifyFromSnapshot(); } /** Creates and initializes a server or peer with all empty or accessor regions. */ public synchronized static void HydraTask_initializeProxyDuringShutDownAll() { try { HydraTask_initializeProxy(); } catch (CacheClosedException e) { Log.getLogWriter().info("Caught " + e); } catch (IllegalStateException e) { String errStr = e.toString(); if (errStr.indexOf("Region specified in 'colocated-with' is not present. It should be " + "created before setting 'colocated-with' to this region.") >= 0) { // OK, this is accepted during a shutDownAll Log.getLogWriter().info("Caught " + e); } else { throw e; } } catch (DistributedSystemDisconnectedException e) { Log.getLogWriter().info("Caught " + e); } catch (PartitionedRegionException e) { Throwable causedBy = e.getCause(); if (causedBy instanceof CacheClosedException) { Log.getLogWriter().info("Caught " + e + " caused by " + causedBy); } else { throw e; } } } /** Initialize an instance of this test class, called once per vm. * */ private void initializeInstance() { isBridgeConfiguration = TestConfig.tab().vecAt(BridgePrms.names, null) != null; maxPRs = RecoveryPrms.getMaxPRs(); maxReplicates = RecoveryPrms.getMaxReplicates(); } /** * Creates a (disconnected) locator. */ public static void createLocatorTask() { DistributedSystemHelper.createLocator(); } /** * Connects a locator to its distributed system. */ public static void startAndConnectLocatorTask() { DistributedSystemHelper.startLocatorAndAdminDS(); } /** Register interest with ALL_KEYS, and InterestPolicyResult = KEYS_VALUES * which is equivalent to a full GII. */ protected static void registerInterest() { Set<Region<?,?>> rootRegions = CacheHelper.getCache().rootRegions(); for (Region aRegion: rootRegions) { Log.getLogWriter().info("Calling registerInterest for all keys, result interest policy KEYS_VALUES for region " + aRegion.getFullPath()); aRegion.registerInterest("ALL_KEYS", InterestResultPolicy.KEYS_VALUES); Log.getLogWriter().info("Done calling registerInterest for all keys, " + "result interest policy KEYS_VALUES, " + aRegion.getFullPath() + " size is " + aRegion.size()); } } /** Loads regions with data. This is a batched task, and each thread will repeatedly * run this task until it loads RecoveryPrms.numToLoad new entries. Each invocation * of this task will keep working until this thread loads the specified number of entries * then it will throw a StopSchedulingTaskOnclientOrder exception. */ public static void HydraTask_load() { int numToLoad = RecoveryPrms.getNumToLoad(); // number of keys to be put by each thread int CHUNK_SIZE = 50; RandomValues rv = new RandomValues(); Set<Region<?, ?>> regionSet = new HashSet(CacheHelper.getCache().rootRegions()); Set<Region<?, ?>> rootRegions = new HashSet(regionSet); for (Region aRegion: rootRegions) { regionSet.addAll(aRegion.subregions(true)); } int currentNumber = (Integer) currentNumKeys.get(); HashMap putAllMap = new HashMap(); int putAllMapSize = Math.min(CHUNK_SIZE, numToLoad-currentNumber); for (int i = 1; i <= putAllMapSize; i++) { Object key = NameFactory.getNextPositiveObjectName(); Object value = new ValueHolder((String)key, rv); putAllMap.put(key, value); } currentNumber += putAllMapSize; currentNumKeys.set(new Integer(currentNumber)); Log.getLogWriter().info("Created putAll map of size " + putAllMap.size() + ", loading " + currentNumber + " entries out of " + numToLoad + " for this load thread"); for (Region aRegion: regionSet) { Log.getLogWriter().info("Calling putAll with map of size " + putAllMap.size() + " with region " + aRegion.getFullPath()); aRegion.putAll(putAllMap); } if (currentNumber >= numToLoad) { throw new StopSchedulingTaskOnClientOrder("All " + numToLoad + " entries created in all regions by this load thread"); } } /** Loads regions with data. This is a batched task, and each thread will repeatedly * run this task until it loads RecoveryPrms.numToLoad new entries. Each invocation * of this task will keep working until this thread loads the specified number of entries * then it will throw a StopSchedulingTaskOnclientOrder exception. */ public static void HydraTask_loadXmlRegions() { int numToLoad = RecoveryPrms.getNumToLoad(); // number of keys to be put by each thread int CHUNK_SIZE = 50; RandomValues rv = new RandomValues(); Set<Region<?, ?>> regionSet = CacheHelper.getCache().rootRegions(); int currentNumber = (Integer) currentNumKeys.get(); HashMap putAllMap = new HashMap(); int putAllMapSize = Math.min(CHUNK_SIZE, numToLoad-currentNumber); for (int i = 1; i <= putAllMapSize; i++) { String key = NameFactory.getNextPositiveObjectName(); Object value = new ValueHolder(key, rv); putAllMap.put(key, value); } currentNumber += putAllMapSize; currentNumKeys.set(new Integer(currentNumber)); Log.getLogWriter().info("Created putAll map of size " + putAllMap.size() + ", loading " + currentNumber + " entries out of " + numToLoad + " for this load thread"); for (Region aRegion: regionSet) { String regName = aRegion.getName(); if (!regName.equals("product") && (!regName.equals("backOfficeAccount")) && (!regName.equals("backOfficeAccountCollection"))) { Log.getLogWriter().info("Calling putAll with map of size " + putAllMap.size() + " with region " + aRegion.getFullPath()); aRegion.putAll(putAllMap); } } Region aRegion = CacheHelper.getCache().getRegion("product"); for (Object key: putAllMap.keySet()) { Product value = new Product(); value.productCode = (String) key; value.instrumentId = (String) key; putAllMap.put(key, value); } aRegion.putAll(putAllMap); aRegion = CacheHelper.getCache().getRegion("backOfficeAccount"); for (Object key: putAllMap.keySet()) { BackOfficeAccount value = new BackOfficeAccount(); value.account = (String) key; putAllMap.put(key, value); } aRegion.putAll(putAllMap); aRegion = CacheHelper.getCache().getRegion("backOfficeAccountCollection"); for (Object key: putAllMap.keySet()) { BackOfficeAccountCollection value = new BackOfficeAccountCollection(); putAllMap.put(key, value); } aRegion.putAll(putAllMap); Log.getLogWriter().info("Printing current region hierarchy with sizes"); Log.getLogWriter().info(RecoveryTest.regionHierarchyToString()); if (currentNumber >= numToLoad) { Log.getLogWriter().info("All regions loaded "); Log.getLogWriter().info(RecoveryTest.regionHierarchyToString()); throw new StopSchedulingTaskOnClientOrder("All " + numToLoad + " entries created in all regions by this load thread"); } } /** Do continuous updates on existing keys using putAll, catching any exceptions. * Exceptions can be expected due to jvms being stopped. */ public static void HydraTask_doContinuousUpdates() { int PUT_ALL_SIZE = 50; RandomValues rv = new RandomValues(); GsRandom rand = TestConfig.tab().getRandGen(); Cache theCache = CacheHelper.getCache(); if (theCache == null) { // we might be shutting down return; } try { Set<Region<?, ?>> regionSet = theCache.rootRegions(); long maxKey = NameFactory.getPositiveNameCounter(); HashMap putAllMap = new HashMap(); for (int i = 1; i <= PUT_ALL_SIZE; i++) { long randInt = rand.nextLong(1, maxKey); Object key = NameFactory.getObjectNameForCounter(randInt); Object value = new ValueHolder((String)key, rv); putAllMap.put(key, value); } Log.getLogWriter().info("Created putAll map of size " + putAllMap.size() + ", updating all regions with putAll...);"); for (Region aRegion: regionSet) { Log.getLogWriter().info("Calling putAll with map of size " + putAllMap.size() + " with region " + aRegion.getFullPath()); aRegion.putAll(putAllMap); } } catch (CacheClosedException e) { // shutdownAll is occurring during updates Log.getLogWriter().info("HydraTask_doContinuousUpdates caught " + e); } catch (RegionDestroyedException e) { Log.getLogWriter().info("HydraTask_doContinuousUpdates caught " + e); } catch (DistributedSystemDisconnectedException e) { Log.getLogWriter().info("HydraTask_doContinuousUpdates caught " + e); } catch (PartitionedRegionStorageException e) { String errStr = e.getMessage().toString(); if (errStr.indexOf("Unable to find any members to host a bucket") >= 0) { Log.getLogWriter().info("HydraTask_doContinuousUpdates caught " + e); } else { throw e; } } catch (PersistentReplicatesOfflineException e) { Log.getLogWriter().info("HydraTask_doContinuousUpdates caught " + e); } } /** Do updates in wan test. * Do updates for 1/3 of the existing keys until we get the signal that shutDownAll has * completed (and then some) in the other wan site. * Then do updates for the another 1/3 of the keys while the vms in the other wan site * recover. * This is so we can know that updates happening during shutDownAll and recovery are * consistent. If we didn't separate the keys in groups, the ops occurring during/after * recovery might overwrite the ops we expect to eventually see during shutDownAll. * Note: the other 1/3 keys is updated in the wan site that shuts down. */ public static void HydraTask_doWanUpdates() { long maxKey = NameFactory.getPositiveNameCounter(); int firstLimit = (int) (maxKey / 3); int secondLimit = firstLimit * 2; String tgname = RemoteTestModule.getCurrentThread().getThreadGroupName(); HydraThreadGroup tg = TestConfig.getInstance().getThreadGroup(tgname); int numThreads = tg.getTotalThreads() * 2; // number of threads in this thread group AND the other site's threads Log.getLogWriter().info("maxKey is " + maxKey + ", firstLimit is " + firstLimit + ", secondLimit is " + secondLimit); // do updates until we get the signal that shutDownAll has completed in the other wan site SharedCounters sc = RecoveryBB.getBB().getSharedCounters(); long threadBaseIndex = sc.incrementAndRead(RecoveryBB.currValue); // used for unique keys per thread long keyIndex = threadBaseIndex; RandomValues rv = new RandomValues(); Set<Region<?, ?>> regionSet = CacheHelper.getCache().rootRegions(); Log.getLogWriter().info("Doing updates before/during shutDownAll with threadBaseIndex " + threadBaseIndex + " and key increment " + numThreads); while (sc.read(RecoveryBB.shutDownAllCompleted) == 0) { Object key = NameFactory.getObjectNameForCounter(keyIndex); for (Region aRegion: regionSet) { BaseValueHolder currValue = (BaseValueHolder) aRegion.get(key); BaseValueHolder updatedValue = new ValueHolder((String)key, rv); updatedValue.myValue = ((Long)(currValue.myValue)) + 1; Log.getLogWriter().info("Putting " + key + ", " + TestHelper.toString(updatedValue) + " in region " + aRegion.getFullPath()); aRegion.put(key, updatedValue); } keyIndex += numThreads; if (keyIndex > firstLimit) { keyIndex = threadBaseIndex; // start over } } // now do updates until we get the signal that recovery has completed in the other wan site while (keyIndex < firstLimit) { keyIndex += numThreads; } threadBaseIndex = keyIndex; // 2nd half key range base index Log.getLogWriter().info("Doing updates during recovery with threadBaseIndex " + threadBaseIndex + " and key increment " + numThreads); int numThreadsPerSite = tg.getTotalThreads(); while (sc.read(RecoveryBB.serversAreBack) != numThreadsPerSite) { Object key = NameFactory.getObjectNameForCounter(keyIndex); for (Region aRegion: regionSet) { BaseValueHolder currValue = (BaseValueHolder) aRegion.get(key); BaseValueHolder updatedValue = new ValueHolder((String)key, rv); updatedValue.myValue = ((Long)(currValue.myValue)) + 1; Log.getLogWriter().info("Putting " + key + ", " + TestHelper.toString(updatedValue) + " in region " + aRegion.getFullPath()); aRegion.put(key, updatedValue); } keyIndex += numThreads; if (keyIndex > secondLimit) { keyIndex = threadBaseIndex; // start over } } // pause and write to the blackboard Log.getLogWriter().info("Signaling pause..."); sc.incrementAndRead(RecoveryBB.pausing); TestHelper.waitForCounter(RecoveryBB.getBB(), "pausing", RecoveryBB.pausing, numThreadsPerSite, true, -1, 3000); // all threads have paused SilenceListener.waitForSilence(30, 2000); long leader = sc.incrementAndRead(RecoveryBB.leader); if (leader == 1) { Log.getLogWriter().info("This thread is the leader, writing snapshot..."); writeSnapshot(); sc.incrementAndRead(RecoveryBB.snapshotWritten); } else { TestHelper.waitForCounter(RecoveryBB.getBB(), "snapshotWritten", RecoveryBB.snapshotWritten, 1, true, -1, 3000); testInstance.verifyFromSnapshot(); } throw new StopSchedulingTaskOnClientOrder(); } /** Do updates in wan test in a wan site that will undergo shutDownAll. Ops * continue until the wan site is shutdown. * Do updates for the final 1/3 of keys (see HydraTask_doWanUpdates for * updates on the other 2/3 of keys. */ public static void HydraTask_doWanUpdatesDuringShutDownAll() { SharedCounters sc = RecoveryBB.getBB().getSharedCounters(); if (sc.read(RecoveryBB.shutDownAllCompleted) >= 1) { // no ops after recovery throw new StopSchedulingTaskOnClientOrder(); } // it's before the shutDownAll, do ops long maxKey = NameFactory.getPositiveNameCounter(); int lowerLimit = (int) ((maxKey / 3) * 2) + 1; String tgname = RemoteTestModule.getCurrentThread().getThreadGroupName(); HydraThreadGroup tg = TestConfig.getInstance().getThreadGroup(tgname); int numThreads = tg.getTotalThreads() * 2; // number of threads in this thread group AND the other site's threads Log.getLogWriter().info("maxKey is " + maxKey + ", lowerLimit is " + lowerLimit); // do updates until we get the signal that shutDownAll has completed in this wan site long threadBaseIndex = sc.incrementAndRead(RecoveryBB.currValue); // used for unique keys per thread long keyIndex = threadBaseIndex; RandomValues rv = new RandomValues(); Set<Region<?, ?>> regionSet = CacheHelper.getCache().rootRegions(); Log.getLogWriter().info("Doing ops until this jvm is stopped with shutDownAll, threadBaseIndex is " + threadBaseIndex + " and key increment " + numThreads); try { while (true) { // do ops until shutDownAll stops them Object key = NameFactory.getObjectNameForCounter(keyIndex); for (Region aRegion: regionSet) { BaseValueHolder currValue = (BaseValueHolder) aRegion.get(key); BaseValueHolder updatedValue = new ValueHolder((String)key, rv); updatedValue.myValue = ((Long)(currValue.myValue)) + 1; Log.getLogWriter().info("Putting " + key + ", " + TestHelper.toString(updatedValue) + " in region " + aRegion.getFullPath()); aRegion.put(key, updatedValue); } keyIndex += numThreads; if (keyIndex > maxKey) { keyIndex = threadBaseIndex; // start over } } } catch (CacheClosedException e) { Log.getLogWriter().info("Caught expected " + e); MasterController.sleepForMs(3600000); // sleep until this jvm is killed } catch (RegionDestroyedException e) { Log.getLogWriter().info("Caught expected " + e); MasterController.sleepForMs(3600000); // sleep until this jvm is killed } catch (GatewayCancelledException e) { Log.getLogWriter().info("Caught expected " + e); MasterController.sleepForMs(3600000); // sleep until this jvm is killed } } /** Execute customer provided queries * */ public static void HydraTask_doQueries() { long maxKeyIndex = NameFactory.getPositiveNameCounter(); long midPointKeyIndex = maxKeyIndex / 2; String maxKey = NameFactory.getObjectNameForCounter(maxKeyIndex); String midPointKey = NameFactory.getObjectNameForCounter(midPointKeyIndex); QueryService qs = CacheHelper.getCache().getQueryService(); String[] queries = new String[] { "select * from /product", "select * from /product where productCode <= '" + midPointKey + "'", "select * from /product where productCode > '" + midPointKey + "'", "select * from /product where productCode = '" + midPointKey + "'", "select * from /product where productCode <> '" + midPointKey + "'", "select * from /product where productCode < '" + maxKey + "'", "select * from /product where productCode >= '" + maxKey + "'", "select * from /product where productCode = '" + maxKey + "'", "select * from /product where productCode <> '" + maxKey + "'", "select * from /product where productCode < 'Object_1'", "select * from /product where productCode >= 'Object_1'", "select * from /product where productCode = 'Object_1'", "select * from /product where productCode <> 'Object_1'", "select * from /backOfficeAccount", "select * from /backOfficeAccount where account <= '" + midPointKey + "'", "select * from /backOfficeAccount where account > '" + midPointKey + "'", "select * from /backOfficeAccount where account = '" + midPointKey + "'", "select * from /backOfficeAccount where account <> '" + midPointKey + "'", "select * from /backOfficeAccount where account < '" + maxKey + "'", "select * from /backOfficeAccount where account >= '" + maxKey + "'", "select * from /backOfficeAccount where account = '" + maxKey + "'", "select * from /backOfficeAccount where account <> '" + maxKey + "'", "select * from /backOfficeAccount where account < 'Object_1'", "select * from /backOfficeAccount where account >= 'Object_1'", "select * from /backOfficeAccount where account = 'Object_1'", "select * from /backOfficeAccount where account <> 'Object_1'", }; for (String qStr: queries) { Log.getLogWriter().info("Executing query: " + qStr); Query aQuery = qs.newQuery(qStr); try { SelectResults results = (SelectResults) aQuery.execute(); Log.getLogWriter().info("Result size is " + results.size()); // for (Object singleResult: results) { // Log.getLogWriter().info(" result is " + singleResult); // } } catch (FunctionDomainException e) { throw new TestException(TestHelper.getStackTrace(e)); } catch (TypeMismatchException e) { throw new TestException(TestHelper.getStackTrace(e)); } catch (NameResolutionException e) { throw new TestException(TestHelper.getStackTrace(e)); } catch (QueryInvocationTargetException e) { throw new TestException(TestHelper.getStackTrace(e)); } } } /** Execute customer provided queries * */ public static void HydraTask_doQueriesDuringShutdown() { HydraTask_doQueries(); } /** Write a snapshot of all regions to the blackboard. * */ private static void writeSnapshot() { Set<Region<?, ?>> regionSet = CacheHelper.getCache().rootRegions(); Log.getLogWriter().info("Preparing to write snapshot for " + regionSet.size() + " regions"); Map allRegionsSnapshot = new HashMap(); for (Region aRegion: regionSet) { Map regionSnapshot = new HashMap(); if (aRegion.getAttributes().getDataPolicy().withPersistence()) { // only persistent regions will have values when restarted for (Object key: aRegion.keySet()) { Object value = null; if (aRegion.containsValueForKey(key)) { // won't invoke a loader (if any) value = aRegion.get(key); } if (value instanceof BaseValueHolder) { regionSnapshot.put(key, ((BaseValueHolder)value).myValue); } else { regionSnapshot.put(key, value); } } } else { Log.getLogWriter().info(aRegion.getFullPath() + " is size " + aRegion.size() + " but it is not persistent, so snapshot size is " + regionSnapshot.size() + " (the region will be empty after stop/restart)"); } allRegionsSnapshot.put(aRegion.getFullPath(), regionSnapshot); Log.getLogWriter().info("Region snapshot for " + aRegion.getFullPath() + " is size " + regionSnapshot.size() + " and contains keys " + regionSnapshot.keySet()); } RecoveryBB.getBB().getSharedMap().put(allRegionsSnapshotKey, allRegionsSnapshot); Log.getLogWriter().info("Put snapshot for " + regionSet.size() + " regions into blackboard at key " + allRegionsSnapshotKey); } /** For each region written to the blackboard, verify its state against the region * in this vm. * */ private void verifyFromSnapshot() { Map<String, Map> allRegionsSnapshot = (Map)(RecoveryBB.getBB().getSharedMap().get(allRegionsSnapshotKey)); Set snapshotRegionNames = allRegionsSnapshot.keySet(); Set<String> definedRegionNames = new HashSet(); Set<Region<?, ?>> regionSet = CacheHelper.getCache().rootRegions(); for (Region aRegion: regionSet) { definedRegionNames.add(aRegion.getFullPath()); Set<Region> subRegSet = aRegion.subregions(true); for (Region subReg: subRegSet) { definedRegionNames.add(subReg.getFullPath()); } } Set missingRegionsInCache = new HashSet(snapshotRegionNames); missingRegionsInCache.removeAll(definedRegionNames); Set extraRegionsInCache = new HashSet(definedRegionNames); extraRegionsInCache.removeAll(snapshotRegionNames); if (missingRegionsInCache.size() != 0) { throw new TestException("Expected to find regions " + missingRegionsInCache + " defined in cache"); } if (extraRegionsInCache.size() != 0) { throw new TestException("Found unexpected regions defined in cache: " + extraRegionsInCache); } Cache theCache = CacheHelper.getCache(); for (String regionName: allRegionsSnapshot.keySet()) { Map regionSnapshot = allRegionsSnapshot.get(regionName); Region aRegion = theCache.getRegion(regionName); if (aRegion == null) { throw new TestException("Region " + regionName + " could not be found in cache"); } verifyFromSnapshot(aRegion, regionSnapshot); } } /** Verify that the given region is consistent with the given snapshot. * * @param aRegion The region to verify * @param snapshot The expected contents of aRegion. */ public void verifyFromSnapshot(Region aRegion, Map regionSnapshot) { // init StringBuffer errStr = new StringBuffer(); int snapshotSize = regionSnapshot.size(); int regionSize = aRegion.size(); long startVerifyTime = System.currentTimeMillis(); Log.getLogWriter().info("Verifying " + aRegion.getFullPath() + " of size " + aRegion.size() + " against snapshot containing " + regionSnapshot.size() + " entries..."); // verify if (snapshotSize != regionSize) { errStr.append("Expected region " + aRegion.getFullPath() + " to be size " + snapshotSize + ", but it is " + regionSize + "\n"); } for (Object key: regionSnapshot.keySet()) { // validate using ParRegUtil calls even if the region is not PR; these calls do the desired job // containsKey try { ParRegUtil.verifyContainsKey(aRegion, key, true); } catch (TestException e) { errStr.append(e.getMessage() + "\n"); } // containsValueForKey boolean containsValueForKey = aRegion.containsValueForKey(key); Object expectedValue = regionSnapshot.get(key); try { ParRegUtil.verifyContainsValueForKey(aRegion, key, (expectedValue != null)); } catch (TestException e) { errStr.append(e.getMessage() + "\n"); } // check the value if (containsValueForKey) { try { Object actualValue = aRegion.get(key); if (actualValue instanceof BaseValueHolder) { ParRegUtil.verifyMyValue(key, expectedValue, actualValue, ParRegUtil.EQUAL); } else { if ((actualValue instanceof byte[]) && (expectedValue instanceof byte[])) { byte[] actual = (byte[])actualValue; byte[] expected = (byte[])expectedValue; if (actual.length != expected.length) { throw new TestException("Expected value for key " + key + " to be " + TestHelper.toString(expectedValue) + ", but it is " + TestHelper.toString(actualValue) + " in " + aRegion.getFullPath()); } } else { throw new TestException("Expected value for key " + key + " to be " + TestHelper.toString(expectedValue) + ", but it is " + TestHelper.toString(actualValue) + " in " + aRegion.getFullPath()); } } } catch (TestException e) { errStr.append(e.getMessage() + "\n"); } } // else value in region is null; the above check for containsValueForKey // checked that the snapshot is also null } // check for extra keys in the region that were not in the snapshot Set aRegionKeySet = new HashSet(aRegion.keySet()); Set snapshotKeySet = regionSnapshot.keySet(); aRegionKeySet.removeAll(snapshotKeySet); if (aRegionKeySet.size() != 0) { errStr.append("Found the following unexpected keys in " + aRegion.getFullPath() + ": " + aRegionKeySet + "\n"); } if (errStr.length() > 0) { throw new TestException(errStr.toString()); } Log.getLogWriter().info("Done verifying " + aRegion.getFullPath() + " from snapshot containing " + snapshotSize + " entries, " + "verification took " + (System.currentTimeMillis() - startVerifyTime) + "ms"); } /** Task to do a shutdownAll, then start the accessors before the dataStores * to reproduce bug 43899. */ public static void HydraTask_shutDownAll() { logExecutionNumber(); AdminDistributedSystem adminDS = AdminHelper.getAdminDistributedSystem(); if (adminDS == null) { throw new TestException("Test is configured to use shutDownAllMembers, but this vm must be an admin vm to use it"); } List<ClientVmInfo> vmList = StopStartVMs.getAllVMs(); List<ClientVmInfo> locators = StopStartVMs.getMatchVMs(vmList, "locator"); List<ClientVmInfo> vmListExcludeLocators = new ArrayList<ClientVmInfo>(); vmListExcludeLocators.addAll(vmList); vmListExcludeLocators.removeAll(locators); List<ClientVmInfo> dataStoreList = StopStartVMs.getMatchVMs(vmList, "dataStore"); List<ClientVmInfo> accessorList = StopStartVMs.getMatchVMs(vmList, "accessor"); List stopModes = new ArrayList(); stopModes.add(ClientVmMgr.MeanKill); Object[] tmp = StopStartVMs.shutDownAllMembers(adminDS, stopModes); List<ClientVmInfo> shutDownAllVMs = (List<ClientVmInfo>)tmp[0]; Set shutDownAllResults = (Set)(tmp[1]); if (shutDownAllResults.size() != vmListExcludeLocators.size()) { // shutdownAll did not return the expected number of members throw new TestException("Expected shutDownAllMembers to return " + vmListExcludeLocators.size() + " members in its result, but it returned " + shutDownAllResults.size() + ": " + shutDownAllResults); } StopStartVMs.startVMs(accessorList); MasterController.sleepForMs(10000); // allow the accessors to start doing ops StopStartVMs.startVMs(dataStoreList); } /** Task to do a shutdownAll in wan test to reproduce bug 43945. */ public static void HydraTask_wanShutDownAll() { logExecutionNumber(); int msToSleep = 30000; Log.getLogWriter().info("Sleeping for " + msToSleep + " ms to allow ops to run before shutDownAll"); MasterController.sleepForMs(msToSleep); // let ops occur while the vms are down AdminDistributedSystem adminDS = AdminHelper.getAdminDistributedSystem(); if (adminDS == null) { throw new TestException("Test is configured to use shutDownAllMembers, but this vm must be an admin vm to use it"); } List<ClientVmInfo> vmList = StopStartVMs.getAllVMs(); // contains vms from only this wan site List stopModes = new ArrayList(); stopModes.add(ClientVmMgr.MeanKill); Object[] tmp = StopStartVMs.shutDownAllMembers(adminDS, stopModes); List<ClientVmInfo> shutDownAllVMs = (List<ClientVmInfo>)tmp[0]; Set shutDownAllResults = (Set)(tmp[1]); if (shutDownAllResults.size() != vmList.size()) { // shutdownAll did not return the expected number of members throw new TestException("Expected shutDownAllMembers to return " + vmList.size() + " members in its result, but it returned " + shutDownAllResults.size() + ": " + shutDownAllResults); } // sleep to allow ops to occur and build up in the wan queue msToSleep = 30000; Log.getLogWriter().info("Sleeping for " + msToSleep + " ms to let wan queue grow after shutDownAll"); MasterController.sleepForMs(msToSleep); // let ops occur while the vms are down RecoveryBB.getBB().getSharedCounters().increment(RecoveryBB.shutDownAllCompleted); StopStartVMs.startVMs(shutDownAllVMs); // this does validation in the init tasks throw new StopSchedulingTaskOnClientOrder(); } /** Task to do a shutdownAll, then start the accessors before the dataStores * to reproduce bug 43899. */ public static void HydraTask_shutDownAllDuringRecovery() { logExecutionNumber(); AdminDistributedSystem adminDS = AdminHelper.getAdminDistributedSystem(); if (adminDS == null) { throw new TestException("Test is configured to use shutDownAllMembers, but this vm must be an admin vm to use it"); } List<ClientVmInfo> vmList = StopStartVMs.getAllVMs(); List<ClientVmInfo> locators = StopStartVMs.getMatchVMs(vmList, "locator"); List<ClientVmInfo> vmListExcludeLocators = new ArrayList<ClientVmInfo>(); vmListExcludeLocators.addAll(vmList); vmListExcludeLocators.removeAll(locators); Log.getLogWriter().info("vmList is " + vmListExcludeLocators); List stopModes = new ArrayList(); for (int i = 0; i < vmListExcludeLocators.size(); i++) { stopModes.add(ClientVmMgr.MeanKill); } Object[] tmp = StopStartVMs.shutDownAllMembers(adminDS, stopModes); List<ClientVmInfo> shutDownAllVMs = (List<ClientVmInfo>)tmp[0]; Set shutDownAllResults = (Set)(tmp[1]); if (shutDownAllResults.size() != vmListExcludeLocators.size()) { // shutdownAll did not return the expected number of members throw new TestException("Expected shutDownAllMembers to return " + vmListExcludeLocators.size() + " members in its result, but it returned " + shutDownAllResults.size() + ": " + shutDownAllResults); } // start the vms List<Thread> threads = StopStartVMs.startAsync(shutDownAllVMs); // start looping shutDownAll calls until all jvms are again shutdown; we loop here because we // don't know at any given moment how many of the restarted jvms have become part of the DS // when shutDownAll is called here int msToSleep = TestConfig.tab().getRandGen().nextInt(10, 60) * 1000; Log.getLogWriter().info("Sleeping for " + msToSleep + " ms before running shutDownAll again"); MasterController.sleepForMs(msToSleep); Log.getLogWriter().info("AdminDS " + adminDS + " is shutting down all members again..."); Set<DistributedMember> memberSet = new HashSet(); while (memberSet.size() < vmListExcludeLocators.size()) { MasterController.sleepForMs(1000); try { long startTime = System.currentTimeMillis(); memberSet.addAll(adminDS.shutDownAllMembers()); long duration = System.currentTimeMillis() - startTime; Log.getLogWriter().info("AdminDS " + adminDS + " shut down (disconnected) the following members " + "(vms remain up): " + memberSet + "; shutDownAll duration " + duration + "ms"); Log.getLogWriter().info(memberSet.size() + " members shut down during recovery phase: " + memberSet + ", target number is " + vmList.size()); } catch (AdminException e1) { throw new TestException(TestHelper.getStackTrace(e1)); } } for (Thread aThread: threads) { try { aThread.join(); } catch (InterruptedException e) { throw new TestException(TestHelper.getStackTrace(e)); } } // restart the jvms from the second round of shutDownAll StopStartVMs.stopStartVMs(vmListExcludeLocators, stopModes); } /** Verify that we have the expected number of regions and that the regions are of * the expected sizes. */ public static void HydraTask_verifyRegionSizes() { Log.getLogWriter().info(RecoveryTest.regionHierarchyToString()); long expectedSize = NameFactory.getPositiveNameCounter(); long expectedNumRegions = maxPRs + maxReplicates; Set<Region<?, ?>> regionSet = CacheHelper.getCache().rootRegions(); if (regionSet.size() != expectedNumRegions) { throw new TestException("Expected " + expectedNumRegions + " but have " + regionSet.size() + regionSet); } StringBuffer regSizeStr = new StringBuffer(); for (Region aRegion: regionSet) { int size = aRegion.size(); if (aRegion.getAttributes().getDataPolicy().isEmpty()) { if (size != 0) { throw new TestException("Expected " + aRegion.getFullPath() + " to be size 0 but it is " + size); } } else { if (size != expectedSize) { throw new TestException("Expected " + aRegion.getFullPath() + " to be size " + expectedSize + " but it is " + size); } } regSizeStr.append(aRegion.getFullPath() + " is size " + size + "\n"); } Log.getLogWriter().info("Verified that regions have correct sizes: " + regSizeStr); } /** Verify that we have the expected number of regions and that the regions are of * the expected sizes for those regions created by customer xml. */ public static void HydraTask_verifyXmlRegionSizes() { verifyXmlRegionSizes(false); } public static void HydraTask_verifyXmlRegionSizesForWAN() { verifyXmlRegionSizes(true); } static void verifyXmlRegionSizes(boolean isWANSetup) { Log.getLogWriter().info(RecoveryTest.regionHierarchyToString()); long expectedSize = NameFactory.getPositiveNameCounter(); final long expectedNumRegions = 30; Set<Region<?, ?>> rootRegions = CacheHelper.getCache().rootRegions(); Set<Region<?, ?>> regionSet = new HashSet(rootRegions); Log.getLogWriter().info("Printing region hierarchy with sizes on Server side: "); Log.getLogWriter().info(RecoveryTest.regionHierarchyToString()); for (Region aRegion: rootRegions) { regionSet.addAll(aRegion.subregions(true)); } if (regionSet.size() != expectedNumRegions) { throw new TestException("Expected " + expectedNumRegions + " but have " + regionSet.size() + regionSet); } // the following regions have all values put by clients; other regions do not due to being local scope // or being defined in the server but not the client (clients do the load step on the regions they know about) String[] regionsWithFullSize = new String[] { "/matchRule", "/allocationRules", "/resequence", "/break", "/product", "/routingEndpoint", "/ldn_applianceAllocation", "/chi_applianceAllocation", "/cacheAdmin", "/backOfficeAccount", "/kpiRuleMetric", "/backOfficeAccountCollection", "/routingRule", "/tradeInstructionCommand", "/latencyMetric", "/adapterAmqpState", "/chi_audit", "/adapterState", "/tradeInstruction", "/cacheResponsibility", "/ldn_audit" }; List regionsWithFullSizeList = Arrays.asList(regionsWithFullSize); StringBuffer regSizeStr = new StringBuffer(); for (Region aRegion: regionSet) { if (regionsWithFullSizeList.contains(aRegion.getFullPath())) { int size = aRegion.size(); if (isWANSetup) { verifyXmlRegionSizeForWAN(aRegion, size, expectedSize); } else { verifyXmlRegionSize(aRegion, size, expectedSize); } regSizeStr.append(aRegion.getFullPath() + " is size " + size + "\n"); } } Log.getLogWriter().info("Verified that regions have correct sizes: " + regSizeStr); } public static void verifyXmlRegionSize(Region aRegion, int size, long expectedSize) { if (aRegion.getAttributes().getDataPolicy().isEmpty()) { if (size != 0) { throw new TestException("Expected " + aRegion.getFullPath() + " to be size 0 but it is " + size); } } else { if (size != expectedSize) { throw new TestException("Expected " + aRegion.getFullPath() + " to be size " + expectedSize + " but it is " + size); } } } public static void verifyXmlRegionSizeForWAN(Region aRegion, int size, long expectedSize) { Log.getLogWriter().info("Region size verfication for region: " + aRegion.getName()); Log.getLogWriter().info("Region's size = " + size); Log.getLogWriter().info( "Expected region Size = " + expectedSize); if (aRegion.getAttributes().getDataPolicy().isEmpty()) { if (size != 0) { throw new TestException("Expected " + aRegion.getFullPath() + " to be size 0 but it is " + size); } } else if (aRegion.getAttributes().getEntryTimeToLive().getTimeout() != 0) { int timeOut = aRegion.getAttributes().getEntryTimeToLive().getTimeout(); if (timeOut > 0 && timeOut <= 30) { if (size != 0) { throw new TestException("Expected " + aRegion.getFullPath() + " to be size 0 because ttl = " + aRegion.getAttributes().getEntryTimeToLive().getTimeout() + " But it is " + size); } } } else if (!aRegion.getAttributes().getEnableGateway()) { boolean singleSitePopulation = TestConfig.tab().booleanAt(WANQueryPrms.populateDataSingleSite, false); if (singleSitePopulation) { if (!(size == expectedSize || size == 0)) { throw new TestException("Expected " + aRegion.getFullPath() + " size to be either 0 or " + expectedSize + " but it is " + size); } } else if (size != expectedSize/2) { throw new TestException("Expected " + aRegion.getFullPath() + " to be size " + expectedSize/2 + " but it is " + size); } } else if (size != expectedSize) { throw new TestException("Expected " + aRegion.getFullPath() + " to be size " + expectedSize + " but it is " + size); } else { Log.getLogWriter().info( "Region size matched expected: for region " + aRegion + " Size: " + size + " expectedSize" + expectedSize); } } /** Verify that we have the expected number of regions and that the regions are of * the expected sizes for those regions created by customer xml. */ public static void HydraTask_verifyXmlRegionSizesAfterRecovery() { Log.getLogWriter().info(RecoveryTest.regionHierarchyToString()); long expectedSize = NameFactory.getPositiveNameCounter(); final long expectedNumRegions = 30; Set<Region<?, ?>> rootRegions = CacheHelper.getCache().rootRegions(); Set<Region<?, ?>> regionSet = new HashSet(rootRegions); for (Region aRegion: rootRegions) { regionSet.addAll(aRegion.subregions(true)); } if (regionSet.size() != expectedNumRegions) { throw new TestException("Expected " + expectedNumRegions + " but have " + regionSet.size() + regionSet); } // the following regions have all values put by clients; other regions do not due to being local scope // or being defined in the server but not the client (clients do the load step on the regions they know about) // or because they are not persistent (and this method is run after disk recovery) String[] regionsWithFullSize = new String[] { "/matchRule", "/allocationRules", "/break", "/product", "/routingEndpoint", "/backOfficeAccount", "/backOfficeAccountCollection", "/routingRule", "/tradeInstructionCommand", "/chi_audit", "/adapterState", "/tradeInstruction", "/ldn_audit" }; List regionsWithFullSizeList = Arrays.asList(regionsWithFullSize); StringBuffer regSizeStr = new StringBuffer(); for (Region aRegion: regionSet) { if (regionsWithFullSizeList.contains(aRegion.getFullPath())) { int size = aRegion.size(); if (aRegion.getAttributes().getDataPolicy().isEmpty()) { if (size != 0) { throw new TestException("Expected " + aRegion.getFullPath() + " to be size 0 but it is " + size); } } else { if (size != expectedSize) { throw new TestException("Expected " + aRegion.getFullPath() + " to be size " + expectedSize + " but it is " + size); } } regSizeStr.append(aRegion.getFullPath() + " is size " + size + "\n"); } } Log.getLogWriter().info("Verified that regions have correct sizes: " + regSizeStr); } /** Log the execution number of this serial task. */ static protected long logExecutionNumber() { long exeNum = RecoveryBB.getBB().getSharedCounters().incrementAndRead(RecoveryBB.executionNumber); Log.getLogWriter().info("Beginning task with execution number " + exeNum); return exeNum; } public static void HydraTask_waitForSilence() { SummaryLogListener.waitForSilence(30, 1000); } public static void HydraTask_waitLongerForSilence() { SummaryLogListener.waitForSilence(240, 1000); } /** Task to do a shutDownAll, then restart * */ public static void HydraTask_startupShutdown() { logExecutionNumber(); long sleepSecBeforeShutDownAll = RecoveryPrms.getSleepSecBeforeShutDownAll(); // defaults to 0 if (sleepSecBeforeShutDownAll > 0) { Log.getLogWriter().info("Sleeping for " + sleepSecBeforeShutDownAll + " seconds"); MasterController.sleepForMs((int)sleepSecBeforeShutDownAll * 1000); } List<ClientVmInfo> vmList = StopStartVMs.getAllVMs(); List<ClientVmInfo> locators = StopStartVMs.getMatchVMs(vmList, "locator"); List<ClientVmInfo> vmListExcludeLocators = new ArrayList<ClientVmInfo>(); vmListExcludeLocators.addAll(vmList); vmListExcludeLocators.removeAll(locators); Log.getLogWriter().info("vmList is " + vmListExcludeLocators); AdminDistributedSystem adminDS = AdminHelper.getAdminDistributedSystem(); Cache theCache = CacheHelper.getCache(); if (adminDS == null) { throw new TestException("Test is configured to use shutDownAllMembers, but this vm must be an admin vm to use it"); } List stopModes = new ArrayList(); stopModes.add(ClientVmMgr.MeanKill); Object[] tmp = StopStartVMs.shutDownAllMembers(adminDS, stopModes); List<ClientVmInfo> shutDownAllVMs = (List<ClientVmInfo>)tmp[0]; Set shutdownAllResults = (Set)(tmp[1]); if (shutdownAllResults.size() != vmListExcludeLocators.size()) { // shutdownAll did not return the expected number of members throw new TestException("Expected shutDownAllMembers to return " + vmListExcludeLocators.size() + " members in its result, but it returned " + shutdownAllResults.size() + ": " + shutdownAllResults); } if (shutdownAllResults.size() > shutDownAllVMs.size()) { // shutdownAllResults is bigger because we shutdown this vm also, but it was not stopped // just disconnected boolean cacheClosed = theCache.isClosed(); if (cacheClosed) { Log.getLogWriter().info("shutDownAllMembers disconnected this vm"); testInstance = null; } else { throw new TestException("shutDownAllMembers should have disconnected this vm, but the cache " + theCache + " isClosed is " + cacheClosed); } } // restart the stopped vms; this will run a dynamic init task to recover from disk Log.getLogWriter().info("Restarting the vms"); List dataStoreVMs = new ArrayList(); List proxyVMs = new ArrayList(); Map sharedMap = RecoveryBB.getBB().getSharedMap().getMap(); for (Object key: sharedMap.keySet()) { if (key instanceof String) { if (((String)key).startsWith("proxy")) { proxyVMs.add(sharedMap.get(key)); } else if (((String)key).startsWith("dataStore")) { dataStoreVMs.add(sharedMap.get(key)); } } } Log.getLogWriter().info("Restarting the vms, dataStoreVMS: " + dataStoreVMs + ", proxyVMs: " + proxyVMs); StopStartVMs.startVMs(dataStoreVMs); if (proxyVMs.size() > 0) { StopStartVMs.startVMs(proxyVMs); } long serversAreBack = RecoveryBB.getBB().getSharedCounters().incrementAndRead(RecoveryBB.serversAreBack); Log.getLogWriter().info("serversAreBack counter is " + serversAreBack); } // @todo lynn Note this task needs // to be upgraded to know when shutDownAll is running. Currently this is just based // on sleeping, which may or may not kill during a shutDownAll. /** Task to run shutdownAll, then kill the vms being shutdown. */ public static void HydraTask_startupShutdownWithKill() { logExecutionNumber(); final List<ClientVmInfo> vmList = StopStartVMs.getAllVMs(); Log.getLogWriter().info("vmList is " + vmList); AdminDistributedSystem adminDS = AdminHelper.getAdminDistributedSystem(); if (adminDS == null) { throw new TestException("Test is configured to use shutDownAllMembers, but this vm must be an admin vm to use it"); } final List stopModes = new ArrayList(); for (int i = 0; i < vmList.size(); i++) { stopModes.add(ClientVmMgr.MeanKill); } boolean killDuringShutDownAll = RecoveryPrms.getKillDuringShutDownAll(); Thread killThread = null; if (killDuringShutDownAll) { killThread = new Thread(new Runnable() { public void run() { int msToSleep = TestConfig.tab().getRandGen().nextInt(5, 35); msToSleep = msToSleep * 1000; Log.getLogWriter().info("Sleeping for " + msToSleep + " ms before killing"); MasterController.sleepForMs(msToSleep); StopStartVMs.stopVMs(vmList, stopModes); Log.getLogWriter().info("killThread is terminating"); } }); killThread = new HydraSubthread(killThread); killThread.start(); } // Invoke shutDownAllMembers Log.getLogWriter().info("AdminDS " + adminDS + " is shutting down all members..."); Set<DistributedMember> memberSet; try { long startTime = System.currentTimeMillis(); memberSet = adminDS.shutDownAllMembers(); long duration = System.currentTimeMillis() - startTime; Log.getLogWriter().info("AdminDS " + adminDS + " shut down (disconnected) the following members " + "(vms remain up): " + memberSet + "; shutDownAll duration " + duration + "ms"); } catch (AdminException e1) { throw new TestException(TestHelper.getStackTrace(e1)); } // can't do this check in case the kill stopped shutdownAll from completing // if (memberSet.size() != vmList.size()) { // shutdownAll did not return the expected number of members // throw new TestException("Expected shutDownAllMembers to return " + vmList.size() + // " members in its result, but it returned " + memberSet.size() + ": " + memberSet); // } if (killThread == null) { StopStartVMs.stopVMs(vmList, stopModes); } else { Log.getLogWriter().info("Waiting for killThread to terminate"); try { killThread.join(); } catch (InterruptedException e) { throw new TestException(TestHelper.getStackTrace(e)); } } // restart the stopped vms; this will run a dynamic init task to recover from disk StopStartVMs.startVMs(vmList); } public synchronized static void HydraTask_initWithXml() { if (testInstance == null) { testInstance = new StartupShutdownTest(); testInstance.initializeInstance(); String newXmlFile = "VmId_" + RemoteTestModule.getMyVmid() + ".xml"; File aFile = new File(newXmlFile); if (!aFile.exists()) { String JTESTS = System.getProperty("JTESTS"); String xmlTemplate = JTESTS + File.separator + "largeScale" + File.separator + "newedge" + File.separator + "gemfire-server.xml.template"; modifyXml(xmlTemplate, newXmlFile); } CacheHelper.createCacheFromXml(newXmlFile); Log.getLogWriter().info(RecoveryTest.regionHierarchyToString()); int myVmId = RemoteTestModule.getMyVmid(); RecoveryBB.getBB().getSharedMap().put("dataStoreJvm_" + myVmId, new ClientVmInfo(myVmId)); } } public synchronized static void HydraTask_initClientWithXml() { if (testInstance == null) { testInstance = new StartupShutdownTest(); testInstance.initializeInstance(); // create client region to get the ports set in the xml; this is a workaround done // 11/2011 until Lise finishes gemfirexd work and has time for hydra support for this String newXmlFile = "VmId_" + RemoteTestModule.getMyVmid() + ".xml"; File aFile = new File(newXmlFile); if (!aFile.exists()) { CacheHelper.createCache("cache1"); RegionHelper.createRegion("clientRegion"); CacheHelper.generateCacheXmlFile("cache1", "clientRegion", null, "clientPool", newXmlFile); // disconnect and modify the xml to include customer defined regions; then we can // reinit this jvm using the desired xml DistributedSystemHelper.disconnect(); String JTESTS = System.getProperty("JTESTS"); String xmlTemplate = JTESTS + File.separator + "largeScale" + File.separator + "newedge" + File.separator + "gemfire-client.xml.template"; modifyClientXml(xmlTemplate, newXmlFile); } CacheHelper.createCacheFromXml(newXmlFile); Log.getLogWriter().info(RecoveryTest.regionHierarchyToString()); } currentNumKeys.set(new Integer(0)); Log.getLogWriter().info("currentNumKeys is " + currentNumKeys); } /** Modify the client xml file by replacing the temporary region already in it * with the customer defined regions in the template. * @param xmlTemplate Contains customer defined regions; not a whole and complete xml file * @param newXmlFile A whole and complete xml file containing a temporary region; replace it * with the customer regions in xmlTemplate. */ private static void modifyClientXml(String xmlTemplate, String newXmlFile) { StringBuffer newXml = new StringBuffer(); try { File aFile = new File(newXmlFile); BufferedReader reader = new BufferedReader(new FileReader(aFile.getAbsoluteFile())); String line = reader.readLine(); while (line != null) { String searchStr = "region name="; int index = line.indexOf(searchStr); if (index >= 0) { // add the template to the rest of the newXml text File templateFile = new File(xmlTemplate); BufferedReader templateReader = new BufferedReader(new FileReader(templateFile.getAbsoluteFile())); String templateLine = templateReader.readLine(); while (templateLine != null) { newXml.append(templateLine + "\n"); templateLine = templateReader.readLine(); } newXml.append("</cache>"); break; } newXml.append(line + "\n"); line = reader.readLine(); } } catch (IOException e) { throw new TestException(TestHelper.getStackTrace(e)); } PrintWriter outFile; try { outFile = new PrintWriter(new FileOutputStream(new File(newXmlFile))); outFile.print(newXml.toString()); outFile.flush(); outFile.close(); } catch (FileNotFoundException e) { Log.getLogWriter().info("Unable to create " + newXmlFile + " due to " + e.toString()); } } /** Modify an xml template file provided by New Edge * * @param xmlFilePath The path to a file containing xml to modify * @param newXmlFilePath The modified xml is written to this file. */ private static void modifyXml(String xmlFilePath, String newXmlFilePath) { StringBuffer newXml = new StringBuffer(); try { File aFile = new File(xmlFilePath); BufferedReader reader = new BufferedReader(new FileReader(aFile.getAbsoluteFile())); String line = reader.readLine(); String currDir = System.getProperty("user.dir"); String diskDirStr = currDir + File.separator + "vm_" + RemoteTestModule.getMyVmid() + "_disk_1"; File diskDir = new File(diskDirStr); diskDir.mkdirs(); String osName= System.getProperty("os.name"); Log.getLogWriter().info("diskDirStr before = " + diskDirStr); if (osName.indexOf("Win") != -1 || osName.indexOf("win") != -1) { diskDirStr = replaceSingleBackSlashWithDoublBackSlash(diskDirStr).toString(); } Log.getLogWriter().info("diskDirStr after = " + diskDirStr); while (line != null) { String searchStr = "%DISK_DIR%"; int index = line.indexOf(searchStr); if (index >= 0) { line = line.replaceAll("%DISK_DIR%", diskDirStr); } newXml.append(line + "\n"); line = reader.readLine(); } } catch (IOException e) { throw new TestException(TestHelper.getStackTrace(e)); } PrintWriter outFile; try { outFile = new PrintWriter(new FileOutputStream(new File(newXmlFilePath))); outFile.print(newXml.toString()); outFile.flush(); outFile.close(); } catch (FileNotFoundException e) { Log.getLogWriter().info("Unable to create " + newXmlFilePath + " due to " + e.toString()); } } static StringBuffer replaceSingleBackSlashWithDoublBackSlash(String input) { StringBuffer output = new StringBuffer(); for (int i = 0; i < input.length(); i++) { char c = input.charAt(i); if (c == '\\') { output.append('\\'); output.append('\\'); } else { output.append(c); } } return output; } /** Generate a cache xml file * * @param fileName The name of the xml file to create. */ private static void generateCacheXmlFile(String fileName) { File aFile = new File(fileName); if (aFile.exists()) { return; } PrintWriter pw = null; try { pw = new PrintWriter(new FileWriter(new File(fileName))); } catch (IOException e) { throw new TestException(TestHelper.getStackTrace(e)); } CacheXmlGenerator.generate(CacheHelper.getCache(), pw); pw.close(); Log.getLogWriter().info("Generated XML file: " + fileName); } }
44.862601
168
0.674774
ff1bcecce7e38046587e0d42d624e04507f7f021
1,310
//package org.asion.sample.common; // //import org.apache.commons.lang3.StringUtils; //import org.aspectj.lang.ProceedingJoinPoint; //import org.aspectj.lang.annotation.Around; //import org.aspectj.lang.annotation.Aspect; //import org.slf4j.Logger; //import org.slf4j.LoggerFactory; //import org.springframework.util.StopWatch; // ///** // * 方法拦截记录执行时间 // * @author Asion. // * @since 16/6/1. // */ //@Aspect //public class MethodTimeAdvice { // // public static Logger logger = LoggerFactory.getLogger(MethodTimeAdvice.class); // // /** // * 拦截要执行的目标方法 // */ // @Around("execution(* com.ytx.seller.workspace.item.ItemImportController.*(..))") // public Object invoke(ProceedingJoinPoint pjp) throws Throwable { // //用 commons-lang 提供的 StopWatch 计时,Spring 也提供了一个 StopWatch // StopWatch clock = new StopWatch(); // clock.start(); //计时开始 // Object result = pjp.proceed(); // clock.stop(); //计时结束 // // //方法参数类型,转换成简单类型 // Object[] params = pjp.getArgs(); // logger.info("Method cost: " + clock.getTotalTimeMillis() + " ms [" // + pjp.getSignature().getDeclaringType().getSimpleName() + "." // + pjp.getSignature().getName() + "("+ StringUtils.join(params,",")+")] "); // return result; // } //}
32.75
92
0.622901
744baa17f5283a28ac1f7ef9720410dd439287c6
2,179
/* Annot8 (annot8.io) - Licensed under Apache-2.0. */ package io.annot8.implementations.reference.content; import io.annot8.api.data.Content; import io.annot8.api.data.Item; import io.annot8.api.exceptions.Annot8RuntimeException; import io.annot8.api.properties.ImmutableProperties; import io.annot8.common.data.content.InputStreamContent; import io.annot8.implementations.reference.stores.DefaultAnnotationStore; import io.annot8.implementations.support.content.AbstractContent; import io.annot8.implementations.support.content.AbstractContentBuilder; import io.annot8.implementations.support.content.AbstractContentBuilderFactory; import java.io.InputStream; import java.util.function.Supplier; public class DefaultInputStream extends AbstractContent<InputStream> implements InputStreamContent { private DefaultInputStream( Item item, String id, String description, ImmutableProperties properties, Supplier<InputStream> data) { super( item, InputStream.class, InputStreamContent.class, DefaultAnnotationStore::new, id, description, properties, data); } public static class Builder extends AbstractContentBuilder<InputStream, DefaultInputStream> { public Builder(Item item) { super(item); } @Override public Content.Builder<DefaultInputStream, InputStream> withData(InputStream data) { throw new Annot8RuntimeException( "Must use a Supplier to provider InputStream, otherwise it can only be read once"); } @Override protected DefaultInputStream create( String id, String description, ImmutableProperties properties, Supplier<InputStream> data) { return new DefaultInputStream(getItem(), id, description, properties, data); } } public static class BuilderFactory extends AbstractContentBuilderFactory<InputStream, DefaultInputStream> { public BuilderFactory() { super(InputStream.class, DefaultInputStream.class); } @Override public Content.Builder<DefaultInputStream, InputStream> create(Item item) { return new DefaultInputStream.Builder(item); } } }
32.522388
100
0.746673
b9de73f8c1c337bd871d0d689c8994ce68d96980
2,662
package com.cdyw.swsw.data.common.listener.radar; import com.cdyw.swsw.common.common.component.CommonPath; import com.cdyw.swsw.common.domain.ao.enums.TypeEnum; import com.cdyw.swsw.data.domain.service.radar.RadarPhasedArrayService; import org.apache.commons.io.monitor.FileAlterationListener; import org.apache.commons.io.monitor.FileAlterationObserver; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import java.io.File; /** * 相控阵雷达原始文件监听器 * * @author jovi */ @Component public class RadarPhasedArrayListener implements FileAlterationListener { private final Logger logger = LoggerFactory.getLogger(getClass()); private final RadarPhasedArrayService radarPhasedArrayService; private final CommonPath commonPath; /** * 因为Filter和Listener加载顺序优先于spring容器初始化实例,所以使用@Autowired肯定为null */ @Autowired public RadarPhasedArrayListener(RadarPhasedArrayService radarPhasedArrayService, CommonPath commonPath) { this.radarPhasedArrayService = radarPhasedArrayService; this.commonPath = commonPath; } @Override public void onFileCreate(File fileSource) { logger.info(TypeEnum.TYPE_RADAR_PHASED_ARRAY.getName() + " onFileCreate: " + fileSource); String tmpFile = "tmp"; int size = 0; // 进入方法之前必须判断文件是否有效 if (fileSource.length() != 0 && !fileSource.getName().contains(tmpFile)) { if (fileSource.getPath().contains(commonPath.getBaseMonitorPath().replace("/", ""))) { size = radarPhasedArrayService.insertRadarPhasedArrayBase(fileSource); } else if (fileSource.getPath().contains(commonPath.getParseMonitorPath().replace("/", ""))) { size = radarPhasedArrayService.insertRadarPhasedArrayParse(fileSource); } logger.info(TypeEnum.TYPE_RADAR_PHASED_ARRAY.getName() + " onFileCreated: " + size + " 条数据"); } else { logger.info(TypeEnum.TYPE_RADAR_PHASED_ARRAY.getName() + " 新增无效文件:" + fileSource.getName() + "。请检查数据源是否正确"); } } @Override public void onStart(FileAlterationObserver observer) { } @Override public void onDirectoryCreate(File directory) { } @Override public void onDirectoryChange(File directory) { } @Override public void onDirectoryDelete(File directory) { } @Override public void onFileChange(File file) { } @Override public void onFileDelete(File file) { } @Override public void onStop(FileAlterationObserver observer) { } }
31.690476
120
0.707363
1a52844d46f18c256049c2390cf4ab008f5f2f3d
2,445
package org.hswebframework.web.datasource.manager.simple; import com.alibaba.fastjson.JSON; import org.hswebframework.web.database.manager.DatabaseManagerService; import org.hswebframework.web.database.manager.SqlExecuteRequest; import org.hswebframework.web.database.manager.SqlExecuteResult; import org.hswebframework.web.database.manager.SqlInfo; import org.hswebframework.web.tests.SimpleWebApplicationTests; import org.junit.Test; import org.springframework.beans.factory.annotation.Autowired; import java.sql.SQLException; import java.util.Arrays; import java.util.List; import java.util.concurrent.CountDownLatch; import static org.junit.Assert.*; /** * TODO 完成注释 * * @author zhouhao */ public class SimpleDatabaseManagerServiceTest extends SimpleWebApplicationTests { @Autowired private DatabaseManagerService databaseManagerService; @Test public void testExecuteSql() throws InterruptedException, SQLException { String id = databaseManagerService.newTransaction(); SqlExecuteRequest request = new SqlExecuteRequest(); SqlInfo sqlInfo = new SqlInfo(); sqlInfo.setSql("create table t_test(name varchar(32))"); sqlInfo.setType("create"); SqlInfo sqlInfo2 = new SqlInfo(); sqlInfo2.setSql("insert into t_test values('1234') "); sqlInfo2.setType("insert"); request.setSql(Arrays.asList(sqlInfo)); List<SqlExecuteResult> results = databaseManagerService.execute(id, request); System.out.println(JSON.toJSONString(results)); request.setSql(Arrays.asList(sqlInfo2)); int total = 1000; CountDownLatch countDownLatch = new CountDownLatch(total); for (int i = 0; i < total; i++) { new Thread(() -> { databaseManagerService.execute(id, request); countDownLatch.countDown(); }).start(); } countDownLatch.await(); sqlInfo = new SqlInfo(); sqlInfo.setSql("select * from t_test"); sqlInfo.setType("select"); request.setSql(Arrays.asList(sqlInfo)); results = databaseManagerService.execute(id, request); System.out.println(JSON.toJSONString(results)); System.out.println(sqlExecutor.list("select * from t_test")); databaseManagerService.rollback(id); Thread.sleep(2000); System.out.println(sqlExecutor.list("select * from t_test").size()); } }
34.43662
85
0.699387
48860242eb9216e290a1a1506f6964bd7efc2202
17,632
package org.prebid.server.auction; import org.apache.commons.lang3.StringUtils; import org.junit.Rule; import org.junit.Test; import org.mockito.junit.MockitoJUnit; import org.mockito.junit.MockitoRule; import org.prebid.server.proto.openrtb.ext.request.ExtGranularityRange; import org.prebid.server.proto.openrtb.ext.request.ExtPriceGranularity; import org.prebid.server.proto.response.Bid; import java.math.BigDecimal; import java.util.Map; import static java.util.Collections.singletonList; import static java.util.Collections.singletonMap; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.entry; import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.anyString; import static org.mockito.BDDMockito.given; import static org.mockito.Mockito.mock; public class TargetingKeywordsCreatorTest { @Rule public final MockitoRule mockitoRule = MockitoJUnit.rule(); @Test public void shouldReturnTargetingKeywordsForOrdinaryBid() { // given final Bid bid = Bid.builder().bidder("bidder1").price(BigDecimal.ONE).dealId("dealId1").cacheId("cacheId1") .width(50).height(100).build(); // when final Map<String, String> keywords = TargetingKeywordsCreator.create( ExtPriceGranularity.of( 2, singletonList(ExtGranularityRange.of(BigDecimal.valueOf(5), BigDecimal.valueOf(0.5)))), true, true, false, 0, null, null, null) .makeFor(bid, false); // then assertThat(keywords).containsOnly( entry("hb_pb_bidder1", "1.00"), entry("hb_bidder_bidder1", "bidder1"), entry("hb_cache_id_bidder1", "cacheId1"), entry("hb_size_bidder1", "50x100"), entry("hb_deal_bidder1", "dealId1")); } @Test public void shouldReturnTargetingKeywordsForOrdinaryBidOpenrtb() { // given final com.iab.openrtb.response.Bid bid = com.iab.openrtb.response.Bid.builder().price(BigDecimal.ONE) .dealid("dealId1").w(50).h(100).build(); // when final Map<String, String> keywords = TargetingKeywordsCreator.create( ExtPriceGranularity.of( 2, singletonList(ExtGranularityRange.of(BigDecimal.valueOf(5), BigDecimal.valueOf(0.5)))), true, true, false, 0, null, null, null) .makeFor(bid, "bidder1", false, null, null); // then assertThat(keywords).containsOnly( entry("hb_pb_bidder1", "1.00"), entry("hb_bidder_bidder1", "bidder1"), entry("hb_size_bidder1", "50x100"), entry("hb_deal_bidder1", "dealId1")); } @Test public void shouldReturnTargetingKeywordsWithEntireKeys() { // given final Bid bid = Bid.builder().bidder("veryververyverylongbidder1").price(BigDecimal.ONE).dealId("dealId1") .cacheId("cacheId1").width(50).height(100).build(); // when final Map<String, String> keywords = TargetingKeywordsCreator.create( ExtPriceGranularity.of( 2, singletonList(ExtGranularityRange.of(BigDecimal.valueOf(5), BigDecimal.valueOf(0.5)))), true, true, false, 0, null, null, null) .makeFor(bid, false); // then assertThat(keywords).containsOnly( entry("hb_pb_veryververyverylongbidder1", "1.00"), entry("hb_bidder_veryververyverylongbidder1", "veryververyverylongbidder1"), entry("hb_cache_id_veryververyverylongbidder1", "cacheId1"), entry("hb_size_veryververyverylongbidder1", "50x100"), entry("hb_deal_veryververyverylongbidder1", "dealId1")); } @Test public void shouldReturnTargetingKeywordsWithEntireKeysOpenrtb() { // given final com.iab.openrtb.response.Bid bid = com.iab.openrtb.response.Bid.builder().price(BigDecimal.ONE) .dealid("dealId1").w(50).h(100).build(); // when final Map<String, String> keywords = TargetingKeywordsCreator.create( ExtPriceGranularity.of( 2, singletonList(ExtGranularityRange.of(BigDecimal.valueOf(5), BigDecimal.valueOf(0.5)))), true, true, false, 0, null, null, null) .makeFor(bid, "veryververyverylongbidder1", false, null, null); // then assertThat(keywords).containsOnly( entry("hb_pb_veryververyverylongbidder1", "1.00"), entry("hb_bidder_veryververyverylongbidder1", "veryververyverylongbidder1"), entry("hb_size_veryververyverylongbidder1", "50x100"), entry("hb_deal_veryververyverylongbidder1", "dealId1")); } @Test public void shouldReturnTargetingKeywordsForWinningBid() { // given final Bid bid = Bid.builder() .bidder("bidder1") .price(BigDecimal.ONE) .dealId("dealId1") .cacheId("cacheId1") .width(50) .height(100) .build(); // when final Map<String, String> keywords = TargetingKeywordsCreator.create( ExtPriceGranularity.of( 2, singletonList(ExtGranularityRange.of(BigDecimal.valueOf(5), BigDecimal.valueOf(0.5)))), true, true, false, 0, null, null, null) .makeFor(bid, true); // then assertThat(keywords).containsOnly( entry("hb_pb_bidder1", "1.00"), entry("hb_bidder_bidder1", "bidder1"), entry("hb_cache_id_bidder1", "cacheId1"), entry("hb_size_bidder1", "50x100"), entry("hb_deal_bidder1", "dealId1"), entry("hb_pb", "1.00"), entry("hb_bidder", "bidder1"), entry("hb_cache_id", "cacheId1"), entry("hb_size", "50x100"), entry("hb_deal", "dealId1")); } @Test public void shouldReturnTargetingKeywordsForWinningBidOpenrtb() { // given final com.iab.openrtb.response.Bid bid = com.iab.openrtb.response.Bid.builder() .price(BigDecimal.ONE) .dealid("dealId1") .w(50) .h(100) .build(); // when final Map<String, String> keywords = TargetingKeywordsCreator.create( ExtPriceGranularity.of( 2, singletonList(ExtGranularityRange.of(BigDecimal.valueOf(5), BigDecimal.valueOf(0.5)))), true, true, false, 0, null, null, null) .makeFor(bid, "bidder1", true, "cacheId1", "videoCacheId1"); // then assertThat(keywords).containsOnly( entry("hb_pb_bidder1", "1.00"), entry("hb_bidder_bidder1", "bidder1"), entry("hb_size_bidder1", "50x100"), entry("hb_deal_bidder1", "dealId1"), entry("hb_pb", "1.00"), entry("hb_bidder", "bidder1"), entry("hb_size", "50x100"), entry("hb_deal", "dealId1"), entry("hb_cache_id", "cacheId1"), entry("hb_cache_id_bidder1", "cacheId1"), entry("hb_uuid", "videoCacheId1"), entry("hb_uuid_bidder1", "videoCacheId1")); } @Test public void shouldFallbackToDefaultPriceIfInvalidPriceGranularity() { // given final Bid bid = Bid.builder().bidder("").price(BigDecimal.valueOf(3.87)).build(); // when final Map<String, String> keywords = TargetingKeywordsCreator.create( "invalid", true, true, false, 0) .makeFor(bid, true); // then assertThat(keywords).contains(entry("hb_pb", StringUtils.EMPTY)); } @Test public void shouldUseDefaultPriceGranularity() { // given final Bid bid = Bid.builder().bidder("").price(BigDecimal.valueOf(3.87)).build(); // when final Map<String, String> keywords = TargetingKeywordsCreator.create(null, true, true, false, 0) .makeFor(bid, true); // then assertThat(keywords).contains(entry("hb_pb", "3.80")); } @Test public void shouldUseDefaultPriceGranularityOpenrtb() { // given final com.iab.openrtb.response.Bid bid = com.iab.openrtb.response.Bid.builder() .price(BigDecimal.valueOf(3.87)).build(); // when final Map<String, String> keywords = TargetingKeywordsCreator.create(null, true, true, false, 0) .makeFor(bid, "", true, null, null); // then assertThat(keywords).contains(entry("hb_pb", "3.80")); } @Test public void shouldNotIncludeCacheIdAndDealIdAndSize() { // given final Bid bid = Bid.builder().bidder("bidder").price(BigDecimal.ONE).build(); // when final Map<String, String> keywords = TargetingKeywordsCreator.create(null, true, true, false, 0) .makeFor(bid, true); // then assertThat(keywords).doesNotContainKeys("hb_cache_id_bidder", "hb_deal_bidder", "hb_size_bidder", "hb_cache_id", "hb_deal", "hb_size"); } @Test public void shouldNotIncludeCacheIdAndDealIdAndSizeOpenrtb() { // given final com.iab.openrtb.response.Bid bid = com.iab.openrtb.response.Bid.builder().price(BigDecimal.ONE).build(); // when final Map<String, String> keywords = TargetingKeywordsCreator.create(null, true, true, false, 0) .makeFor(bid, "bidder", true, null, null); // then assertThat(keywords).doesNotContainKeys("hb_cache_id_bidder", "hb_deal_bidder", "hb_size_bidder", "hb_cache_id", "hb_uuid", "hb_deal", "hb_size"); } @Test public void shouldReturnEnvKeyForAppRequest() { // given final Bid bid = Bid.builder().bidder("bidder").price(BigDecimal.ONE).build(); // when final Map<String, String> keywords = TargetingKeywordsCreator.create(null, true, true, true, 0) .makeFor(bid, true); // then assertThat(keywords).contains( entry("hb_env", "mobile-app"), entry("hb_env_bidder", "mobile-app")); } @Test public void shouldReturnEnvKeyForAppRequestOpenrtb() { // given final com.iab.openrtb.response.Bid bid = com.iab.openrtb.response.Bid.builder().price(BigDecimal.ONE).build(); // when final Map<String, String> keywords = TargetingKeywordsCreator.create(null, true, true, true, 0) .makeFor(bid, "bidder", true, null, null); // then assertThat(keywords).contains( entry("hb_env", "mobile-app"), entry("hb_env_bidder", "mobile-app")); } @Test public void shouldNotIncludeWinningBidTargetingIfIncludeWinnersFlagIsFalse() { // given final com.iab.openrtb.response.Bid bid = com.iab.openrtb.response.Bid.builder().price(BigDecimal.ONE).build(); // when final Map<String, String> keywords = TargetingKeywordsCreator.create(null, false, true, false, 0) .makeFor(bid, "bidder1", true, null, null); // then assertThat(keywords).doesNotContainKeys("hb_bidder", "hb_pb"); } @Test public void shouldIncludeWinningBidTargetingIfIncludeWinnersFlagIsTrue() { // given final com.iab.openrtb.response.Bid bid = com.iab.openrtb.response.Bid.builder().price(BigDecimal.ONE).build(); // when final Map<String, String> keywords = TargetingKeywordsCreator.create(null, true, true, false, 0) .makeFor(bid, "bidder1", true, null, null); // then assertThat(keywords).containsKeys("hb_bidder", "hb_pb"); } @Test public void shouldNotIncludeBidderKeysTargetingIfIncludeBidderKeysFlagIsFalse() { // given final com.iab.openrtb.response.Bid bid = com.iab.openrtb.response.Bid.builder().price(BigDecimal.ONE).build(); // when final Map<String, String> keywords = TargetingKeywordsCreator.create(null, false, false, false, 0) .makeFor(bid, "bidder1", true, null, null); // then assertThat(keywords).doesNotContainKeys("hb_bidder_bidder1", "hb_pb_bidder1"); } @Test public void shouldIncludeBidderKeysTargetingIfIncludeBidderKeysFlagIsTrue() { // given final com.iab.openrtb.response.Bid bid = com.iab.openrtb.response.Bid.builder().price(BigDecimal.ONE).build(); // when final Map<String, String> keywords = TargetingKeywordsCreator.create(null, false, true, false, 0) .makeFor(bid, "bidder1", true, null, null); // then assertThat(keywords).containsKeys("hb_bidder_bidder1", "hb_pb_bidder1"); } @Test public void shouldTruncateTargetingBidderKeywordsIfTruncateAttrCharsIsDefined() { // given final com.iab.openrtb.response.Bid bid = com.iab.openrtb.response.Bid.builder().price(BigDecimal.ONE).build(); // when final Map<String, String> keywords = TargetingKeywordsCreator.create(null, false, true, false, 20) .makeFor(bid, "someVeryLongBidderName", true, null, null); // then assertThat(keywords).hasSize(2) .containsKeys("hb_bidder_someVeryLo", "hb_pb_someVeryLongBi"); } @Test public void shouldTruncateTargetingWithoutBidderSuffixKeywordsIfTruncateAttrCharsIsDefined() { // given final com.iab.openrtb.response.Bid bid = com.iab.openrtb.response.Bid.builder().price(BigDecimal.ONE).build(); // when final Map<String, String> keywords = TargetingKeywordsCreator.create(null, true, false, false, 7) .makeFor(bid, "bidder", true, null, null); // then assertThat(keywords).hasSize(2) .containsKeys("hb_bidd", "hb_pb"); } @Test public void shouldNotTruncateTargetingKeywordsIfTruncateAttrCharsIsNotDefined() { // given final com.iab.openrtb.response.Bid bid = com.iab.openrtb.response.Bid.builder().price(BigDecimal.ONE).build(); // when final Map<String, String> keywords = TargetingKeywordsCreator.create(null, false, true, false, 0) .makeFor(bid, "someVeryLongBidderName", true, null, null); // then assertThat(keywords).hasSize(2) .containsKeys("hb_bidder_someVeryLongBidderName", "hb_pb_someVeryLongBidderName"); } @Test public void shouldTruncateKeysFromResolver() { // given final com.iab.openrtb.response.Bid bid = com.iab.openrtb.response.Bid.builder() .id("bid1") .price(BigDecimal.ONE) .build(); final TargetingKeywordsResolver resolver = mock(TargetingKeywordsResolver.class); given(resolver.resolve(any(), anyString())).willReturn(singletonMap("key_longer_than_twenty", "value1")); // when final Map<String, String> keywords = TargetingKeywordsCreator.create( ExtPriceGranularity.of( 2, singletonList(ExtGranularityRange.of(BigDecimal.valueOf(5), BigDecimal.valueOf(0.5)))), true, true, false, 20, null, null, resolver) .makeFor(bid, "bidder1", true, null, null); // then assertThat(keywords).contains(entry("key_longer_than_twen", "value1")); } @Test public void shouldIncludeKeywordsFromResolver() { // given final com.iab.openrtb.response.Bid bid = com.iab.openrtb.response.Bid.builder() .id("bid1") .price(BigDecimal.ONE) .build(); final TargetingKeywordsResolver resolver = mock(TargetingKeywordsResolver.class); given(resolver.resolve(any(), anyString())).willReturn(singletonMap("keyword1", "value1")); // when final Map<String, String> keywords = TargetingKeywordsCreator.create( ExtPriceGranularity.of( 2, singletonList(ExtGranularityRange.of(BigDecimal.valueOf(5), BigDecimal.valueOf(0.5)))), true, true, false, 0, null, null, resolver) .makeFor(bid, "bidder1", true, null, null); // then assertThat(keywords).contains(entry("keyword1", "value1")); } }
37.198312
118
0.57804
164b71aae04f7d7ac26f8bd5af420b452e8b83e5
686
package com.mock.apimocks.exception; /** * This class represents an Internal Server Error Http response. * <p/> * It is meant to be thrown whenever a generic error occurs on the server. * * @author gabriel.nascimento * @version 1.0 */ public class InternalServerErrorException extends RuntimeException implements HttpError { private final String description; public InternalServerErrorException(String description) { super(); this.description = description; } @Override public String getHttpError() { return "Internal Server Error"; } @Override public String getDescription() { return this.description; } }
23.655172
89
0.695335