Czech translation updated

Timeline stub
This commit is contained in:
Jindra Petk
2014-02-01 22:49:23 +01:00
parent 6672bafe36
commit 8cda3ba8d8
11 changed files with 543 additions and 3 deletions

View File

@@ -0,0 +1,197 @@
/*
* Copyright (C) 2014 JPEXS
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.jpexs.decompiler.flash.gui;
import com.jpexs.decompiler.flash.SWF;
import com.jpexs.decompiler.flash.timeline.DepthState;
import com.jpexs.decompiler.flash.timeline.TimeLine;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Point;
import java.awt.Rectangle;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import javax.swing.JPanel;
/**
*
* @author JPEXS
*/
public class TimeLinePanel extends JPanel implements MouseListener {
private SWF swf;
private TimeLine timeLine;
public static final int FRAME_WIDTH = 10;
public static final int FRAME_HEIGHT = 20;
public static final Color frameColor = Color.lightGray;
public static final Color emptyFrameColor = Color.white;
public static final Color borderColor = Color.black;
public static final Color emptyBorderColor = Color.lightGray;
public static final Color keyColor = Color.black;
public static final Color selectedColor = new Color(113, 174, 235);
public static final Color timeColor = Color.red;
public Point cursor = null;
public TimeLinePanel(SWF swf) {
this.swf = swf;
this.timeLine = new TimeLine(swf);
Dimension dim = new Dimension(FRAME_WIDTH * timeLine.getFrameCount()+1, FRAME_HEIGHT * timeLine.getMaxDepth());
setSize(dim);
setPreferredSize(dim);
addMouseListener(this);
}
@Override
protected void paintComponent(Graphics g) {
//super.paintComponent(g);
Rectangle clip = g.getClipBounds();
int start_f = clip.x / FRAME_WIDTH;
int start_d = clip.y / FRAME_HEIGHT;
int end_f = (clip.x + clip.width) / FRAME_WIDTH;
int end_d = (clip.y + clip.height) / FRAME_HEIGHT;
int max_d = timeLine.getMaxDepth();
if (max_d < end_d) {
end_d = max_d;
}
int max_f = timeLine.getFrameCount() - 1;
if (max_f < end_f) {
end_f = max_f;
}
boolean keyfound[] = new boolean[end_d - start_d + 1];
for (int f = start_f; f <= end_f; f++) {
for (int d = start_d; d <= end_d; d++) {
DepthState fl = timeLine.frames.get(f).layers.get(d);
if(fl == null){
g.setColor(emptyFrameColor);
g.fillRect(f * FRAME_WIDTH, d * FRAME_HEIGHT, FRAME_WIDTH, FRAME_HEIGHT);
g.setColor(emptyBorderColor);
g.drawRect(f * FRAME_WIDTH, d * FRAME_HEIGHT, FRAME_WIDTH, FRAME_HEIGHT);
}
}
}
for (int f = start_f; f <= end_f; f++) {
for (int d = start_d; d <= end_d; d++) {
DepthState fl = timeLine.frames.get(f).layers.get(d);
boolean selected = false;
if (cursor != null) {
if (f == cursor.x && d == cursor.y) {
selected = true;
}
}
if (selected) {
g.setColor(selectedColor);
g.fillRect(f * FRAME_WIDTH+1, d * FRAME_HEIGHT+1, FRAME_WIDTH-1, FRAME_HEIGHT-1);
}
if (fl == null) {
continue;
} else {
int draw_f = 0;
if (fl.key) {
draw_f = f;
keyfound[d - start_d] = true;
} else if (!keyfound[d - start_d]) {
for (int k = f - 1; k >= 0; k--) {
fl = timeLine.frames.get(k).layers.get(d);
if (fl == null) {
break;
}
if (fl.key) {
keyfound[d - start_d] = true;
draw_f = k;
break;
}
}
} else {
continue;
}
int num_frames = 1;
for (int n = draw_f + 1; n < timeLine.getFrameCount(); n++) {
fl = timeLine.frames.get(n).layers.get(d);
if (fl == null) {
break;
}
if (fl.key) {
break;
}
num_frames++;
}
g.setColor(frameColor);
g.fillRect(draw_f * FRAME_WIDTH, d * FRAME_HEIGHT, num_frames * FRAME_WIDTH, FRAME_HEIGHT);
if (selected) {
g.setColor(selectedColor);
g.fillRect(draw_f * FRAME_WIDTH, d * FRAME_HEIGHT, FRAME_WIDTH, FRAME_HEIGHT);
}
g.setColor(borderColor);
g.drawRect(draw_f * FRAME_WIDTH, d * FRAME_HEIGHT, num_frames * FRAME_WIDTH, FRAME_HEIGHT);
g.setColor(keyColor);
g.fillOval(draw_f * FRAME_WIDTH + FRAME_WIDTH / 4, d * FRAME_HEIGHT + FRAME_HEIGHT / 2 - FRAME_WIDTH / 2, FRAME_WIDTH / 2, FRAME_WIDTH / 2);
}
}
}
if(cursor!=null && cursor.x>=start_f && cursor.x<=end_f){
g.setColor(timeColor);
g.drawLine(cursor.x*FRAME_WIDTH + FRAME_WIDTH/2, 0, cursor.x*FRAME_WIDTH + FRAME_WIDTH/2, getHeight());
}
}
@Override
public void mouseClicked(MouseEvent e) {
}
@Override
public void mousePressed(MouseEvent e) {
Point p = e.getPoint();
p.x = p.x / FRAME_WIDTH;
p.y = p.y / FRAME_HEIGHT;
if (p.x >= timeLine.getFrameCount()) {
p.x = timeLine.getFrameCount() - 1;
}
if (p.y > timeLine.getMaxDepth()) {
p.y = timeLine.getMaxDepth();
}
cursor = p;
repaint();
}
@Override
public void mouseReleased(MouseEvent e) {
}
@Override
public void mouseEntered(MouseEvent e) {
}
@Override
public void mouseExited(MouseEvent e) {
}
}

View File

@@ -13,4 +13,9 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
advancedSettings.dialog.title = Pokro\u010dil\u00e1 nastaven\u00ed
advancedSettings.restartConfirmation = N\u011bkter\u00e9 zm\u011bny vy\u017eaduj\u00ed restart programu, ne\u017e se projev\u00ed. Chcete program restartovat nyn\u00ed?
advancedSettings.columns.name = N\u00e1zev
advancedSettings.columns.value = Hodnota
advancedSettings.columns.description = Popis
default = v\u00fdchoz\u00ed

View File

@@ -0,0 +1,16 @@
# Copyright (C) 2013 JPEXS
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU 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 General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
fontPreview.dialog.title = N\u00e1hled p\u00edsma

View File

@@ -23,4 +23,9 @@ swfitem = [SWF verze %version% velikost %size%]
notfound = \u017d\u00e1dn\u00e9 SWF nebylo nalezeno
#after version 1.7.1:
button.save = Ulo\u017eit
button.save = Ulo\u017eit
column.version = Verze
column.fileSize = Velikost
column.pid = PID
column.processName = N\u00e1zev procesu

View File

@@ -384,3 +384,57 @@ contextmenu.closeSwf = Zav\u0159\u00edt SWF
menu.settings.autoRenameIdentifiers = Automaticky p\u0159ejmenovat identifik\u00e1tory
menu.file.saveasexe = Ulo\u017eit jako Exe...
filter.exe = Spustiteln\u00e9 soubory (*.exe)
#after version 1.8.0
font.updateTexts = Aktualizovat texty
#after version 1.8.0u1
menu.file.close = Zav\u0159\u00edt
menu.file.closeAll = Zav\u0159\u00edt v\u0161e
menu.tools.otherTools = Dal\u0161\u00ed
menu.tools.otherTools.clearRecentFiles = Vymazat naposledy otev\u0159en\u00e9
fontName.name = N\u00e1zev pro zobrazen\u00ed:
fontName.copyright = Copyright p\u00edsma:
button.preview = N\u00e1hled
button.reset = Reset
errors.info = V logu jsou INFORMACE. Klikn\u011bte pro zobrazen\u00ed.
errors.warning = V logu jsou VAROV\u00c1N\u00cd. Klikn\u011bte pro zobrazen\u00ed.
decompilationError = Chyba dekompilace
decompilationError.timeout = \u010casov\u00fd limit ({0}) vypr\u0161el
decompilationError.timeout.description = Nedekompilov\u00e1no kv\u016fli \u010dasov\u00e9mu limitu
decompilationError.obfuscated = K\u00f3d m\u016f\u017ee b\u00fdt obfuskov\u00e1n
decompilationError.errorType = Typ chyby
decompilationError.error.description = Nedekompilov\u00e1no kv\u016fli chyb\u011b
#example: 1 hour and 2 minutes
timeFormat.and = a
timeFormat.hour = hodina
timeFormat.hours = hodin
timeFormat.minute = minuta
timeFormat.minutes = minut
timeFormat.second = vte\u0159ina
timeFormat.seconds = vte\u0159in
disassemblingProgress.toString = toString
disassemblingProgress.reading = \u010cten\u00ed
disassemblingProgress.deobfuscating = Deobfuskace
decompilation.skipped = Dekompilace p\u0159esko\u010dena
decompilation.unsupported = Nepodporov\u00e1no dekompil\u00e1torem
decompilerMark = zna\u010dka dekompil\u00e1toru
fontNotFound = P\u00edsmo s id=%fontId% nebylo nalezeno.
contextmenu.moveTag = P\u0159esunout tag do
filter.swc = SWC soubory komponent (*.swc)
filter.zip = ZIP komprimovan\u00e9 soubory (*.zip)
filter.binary = Bin\u00e1rn\u00ed vyhled\u00e1v\u00e1n\u00ed - v\u0161echny soubory (*.*)
open.error = Chyba
open.error.fileNotFound = Soubor nenalezen
open.error.cannotOpen = Soubor nelze otev\u0159\u00edt
node.others = ostatn\u00ed
#after version 1.8.1
menu.tools.search = Hled\u00e1n\u00ed Textu

View File

@@ -22,4 +22,7 @@ button.ok = OK
button.cancel = Storno
dialog.title = Dostupn\u00e1 nov\u00e1 verze
newversion = Nov\u00e1 verze
newvermessage = Nov\u00e1 verze %oldAppName% je dostupn\u00e1: %newAppName%.\r\nPros\u00edm nav\u0161tivte %projectPage% pro jej\u00ed sta\u017een\u00ed.
newvermessage = Nov\u00e1 verze %oldAppName% je dostupn\u00e1: %newAppName%.\r\nPros\u00edm nav\u0161tivte %projectPage% pro jej\u00ed sta\u017een\u00ed.
#change this only when the date format is wrong in the changelog
#you can use any java date format string, e.g: yyyy.MM.dd
customDateFormat = default

View File

@@ -20,4 +20,7 @@ label.searchtext = Hledat text:
#dialog.title = Hledat v ActionScriptu
error = Chyba
error.invalidregexp = Neplatn\u00fd regul\u00e1rn\u00ed v\u00fdraz
error.invalidregexp = Neplatn\u00fd regul\u00e1rn\u00ed v\u00fdraz
checkbox.searchText = Hledat v textech
checkbox.searchAS = Hledat v AS

View File

@@ -0,0 +1,16 @@
# Copyright (C) 2014 JPEXS
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU 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 General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
dialog.title = Timeline view

View File

@@ -0,0 +1,66 @@
/*
* Copyright (C) 2014 JPEXS
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.jpexs.decompiler.flash.timeline;
import com.jpexs.decompiler.flash.tags.base.CharacterTag;
import com.jpexs.decompiler.flash.types.CLIPACTIONS;
import com.jpexs.decompiler.flash.types.CXFORM;
import com.jpexs.decompiler.flash.types.CXFORMWITHALPHA;
import com.jpexs.decompiler.flash.types.MATRIX;
import com.jpexs.decompiler.flash.types.RGBA;
import com.jpexs.decompiler.flash.types.filters.FILTER;
import java.util.ArrayList;
import java.util.List;
/**
*
* @author JPEXS
*/
public class DepthState {
public int characterId;
public MATRIX matrix = null;
public String instanceName = null;
public CXFORM colorTransForm = null;
public CXFORMWITHALPHA colorTransFormAlpha = null;
public boolean cacheAsBitmap = false;
public int blendMode = 0;
public List<FILTER> filters = new ArrayList<>();
public boolean isVisible = true;
public RGBA backGroundColor = null;
public CLIPACTIONS clipActions = null;
public int ratio;
public boolean key=false;
public DepthState(){
}
public DepthState(DepthState obj){
characterId = obj.characterId;
matrix = obj.matrix;
instanceName = obj.instanceName;
colorTransForm = obj.colorTransForm;
colorTransFormAlpha = obj.colorTransFormAlpha;
cacheAsBitmap = obj.cacheAsBitmap;
blendMode = obj.blendMode;
filters = obj.filters;
isVisible = obj.isVisible;
backGroundColor = obj.backGroundColor;
clipActions = obj.clipActions;
ratio = obj.ratio;
}
}

View File

@@ -0,0 +1,40 @@
/*
* Copyright (C) 2014 JPEXS
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.jpexs.decompiler.flash.timeline;
import java.util.HashMap;
import java.util.Map;
/**
*
* @author JPEXS
*/
public class Frame {
public Map<Integer,DepthState> layers = new HashMap<>();
public Frame(){
}
public Frame(Frame obj){
layers = new HashMap<>();
for(int depth:obj.layers.keySet()){
layers.put(depth, new DepthState(obj.layers.get(depth)));
}
}
}

View File

@@ -0,0 +1,135 @@
/*
* Copyright (C) 2014 JPEXS
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.jpexs.decompiler.flash.timeline;
import com.jpexs.decompiler.flash.SWF;
import com.jpexs.decompiler.flash.tags.ShowFrameTag;
import com.jpexs.decompiler.flash.tags.Tag;
import com.jpexs.decompiler.flash.tags.base.PlaceObjectTypeTag;
import com.jpexs.decompiler.flash.tags.base.RemoveTag;
import com.jpexs.decompiler.flash.types.CLIPACTIONS;
import com.jpexs.decompiler.flash.types.CXFORM;
import com.jpexs.decompiler.flash.types.CXFORMWITHALPHA;
import com.jpexs.decompiler.flash.types.MATRIX;
import com.jpexs.decompiler.flash.types.filters.FILTER;
import java.util.ArrayList;
import java.util.List;
/**
*
* @author JPEXS
*/
public class TimeLine {
public List<Frame> frames = new ArrayList<>();
public TimeLine() {
}
public int getMaxDepth()
{
int max_depth=0;
for(Frame f:frames){
for(int depth:f.layers.keySet()){
if(depth>max_depth){
max_depth = depth;
}
}
}
return max_depth;
}
public int getFrameCount(){
return frames.size();
}
public TimeLine(SWF swf) {
Frame frame=new Frame();
for(Tag t:swf.tags){
if(t instanceof PlaceObjectTypeTag){
PlaceObjectTypeTag po=(PlaceObjectTypeTag)t;
int depth=po.getDepth();
if(!frame.layers.containsKey(depth)){
frame.layers.put(depth, new DepthState());
}
DepthState fl = frame.layers.get(depth);
int characterId = po.getCharacterId();
if(characterId!=-1){
fl.characterId = characterId;
}
if (po.flagMove()) {
MATRIX matrix2 = po.getMatrix();
if (matrix2 != null) {
fl.matrix = matrix2;
}
String instanceName2 = po.getInstanceName();
if (instanceName2 != null) {
fl.instanceName = instanceName2;
}
CXFORM colorTransForm2 = po.getColorTransform();
if (colorTransForm2 != null) {
fl.colorTransForm = colorTransForm2;
}
CXFORMWITHALPHA colorTransFormAlpha2 = po.getColorTransformWithAlpha();
if (colorTransFormAlpha2 != null) {
fl.colorTransFormAlpha = colorTransFormAlpha2;
}
CLIPACTIONS clipActions2 = po.getClipActions();
if (clipActions2 != null) {
fl.clipActions = clipActions2;
}
if (po.cacheAsBitmap()) {
fl.cacheAsBitmap = true;
}
int blendMode2 = po.getBlendMode();
if (blendMode2 > 0) {
fl.blendMode = blendMode2;
}
List<FILTER> filters2 = po.getFilters();
if (filters2 != null) {
fl.filters = filters2;
}
int ratio2 = po.getRatio();
if (ratio2 > -1) {
fl.ratio = ratio2;
}
} else {
fl.matrix = po.getMatrix();
fl.instanceName = po.getInstanceName();
fl.colorTransForm = po.getColorTransform();
fl.colorTransFormAlpha = po.getColorTransformWithAlpha();
fl.cacheAsBitmap = po.cacheAsBitmap();
fl.blendMode = po.getBlendMode();
fl.filters = po.getFilters();
fl.ratio = po.getRatio();
fl.clipActions = po.getClipActions();
}
fl.key = true;
}
if(t instanceof RemoveTag){
RemoveTag r=(RemoveTag)t;
int depth=r.getDepth();
frame.layers.remove(depth);
}
if(t instanceof ShowFrameTag){
frames.add(frame);
frame = new Frame(frame);
}
}
}
}