mirror of
https://gitlab.com/biskuteri-cafe/JKomasto2.git
synced 2025-01-09 22:25:53 +01:00
Ran into design problem with timelines..
This commit is contained in:
parent
31277c7871
commit
ce22349538
@ -16,9 +16,9 @@ JKomasto {
|
|||||||
public
|
public
|
||||||
JKomasto()
|
JKomasto()
|
||||||
{
|
{
|
||||||
//new TimelineWindow().setVisible(true);
|
new TimelineWindow().setVisible(true);
|
||||||
//new ComposeWindow().setVisible(true);
|
//new ComposeWindow().setVisible(true);
|
||||||
new PostWindow().setVisible(true);
|
//new PostWindow().setVisible(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// - -%- -
|
// - -%- -
|
||||||
|
@ -291,6 +291,8 @@ RepliesComponent extends JPanel {
|
|||||||
|
|
||||||
int pages = 1 + ((replies.size() - 1) / 8);
|
int pages = 1 + ((replies.size() - 1) / 8);
|
||||||
pageLabel.setText(pageNumber + "/" + pages);
|
pageLabel.setText(pageNumber + "/" + pages);
|
||||||
|
prevPage.setEnabled(pageNumber > 1);
|
||||||
|
nextPage.setEnabled(pageNumber < pages);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ---%-@-%---
|
// ---%-@-%---
|
||||||
|
@ -30,21 +30,22 @@ TimelineWindow extends JFrame {
|
|||||||
private TimelineComponent
|
private TimelineComponent
|
||||||
display;
|
display;
|
||||||
|
|
||||||
// - -%- -
|
|
||||||
|
|
||||||
private static final Timeline
|
|
||||||
NULL_TIMELINE = new Timeline();
|
|
||||||
{
|
|
||||||
NULL_TIMELINE.type = TimelineType.LOCAL;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ---%-@-%---
|
// ---%-@-%---
|
||||||
|
|
||||||
public void
|
public void
|
||||||
setTimeline(Timeline timeline)
|
setTimeline(Timeline timeline)
|
||||||
{
|
{
|
||||||
|
if (timeline == null)
|
||||||
|
{
|
||||||
|
timeline = new Timeline();
|
||||||
|
timeline.type = TimelineType.LOCAL;
|
||||||
|
}
|
||||||
|
|
||||||
assert timeline != null;
|
assert timeline != null;
|
||||||
this.timeline = timeline;
|
this.timeline = timeline;
|
||||||
|
|
||||||
|
// Here, we should request for posts for the timeline.
|
||||||
|
// And pass data to TimelineComponent.
|
||||||
}
|
}
|
||||||
|
|
||||||
// ---%-@-%---
|
// ---%-@-%---
|
||||||
@ -93,6 +94,22 @@ TimelineComponent extends JPanel {
|
|||||||
private final List<PostPreviewComponent>
|
private final List<PostPreviewComponent>
|
||||||
postPreviews = new ArrayList<>();
|
postPreviews = new ArrayList<>();
|
||||||
|
|
||||||
|
// ---%-@-%---
|
||||||
|
|
||||||
|
public void
|
||||||
|
setPosts()
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
* Okay, so timelines are infinite, unlike replies.
|
||||||
|
* We can ask for a finite list of post preview data,
|
||||||
|
* but we're the ones holding the pagination information?
|
||||||
|
*
|
||||||
|
* Or rather, we don't currently.. we should think out
|
||||||
|
* timeline pagination, then have TimelineWindow hold
|
||||||
|
* the data.
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
|
||||||
// ---%-@-%---
|
// ---%-@-%---
|
||||||
|
|
||||||
TimelineComponent()
|
TimelineComponent()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user